+ 3
SQL in Sololearn
Is there any way to program/test SQL on Sololearn?
9 odpowiedzi
+ 4
Jakob
I think this one is short enough.
But you need to acknowledge that you need a database in the first place before you can run any "select", "insert", "delete" or "update" command.
Therefore, there is a "create" command to build a database at the very beginning.
https://sololearn.com/compiler-playground/cmOQV8Je8fF1/?ref=app
+ 5
Somehow it would be done by using Python and sqlite3 library.
And here is an example.
https://sololearn.com/compiler-playground/cKqm1J8dX791/?ref=app
+ 2
No, but I can recommend you the software called SQLite browser that let you do just that
+ 1
Is there a shorter exemple? I'm new with SQL.
+ 1
Is everything OK with you?
+ 1
Thanks but why isn't this code running?
https://sololearn.com/compiler-playground/c1qiew47g99e/?ref=app
+ 1
You almost get there.
If you read the error message, it told you the error occurred at line 19, which is
cur.execute(insert)
In itself is a valid command, so we need to look into the variable (insert) passed to the command, which is defined between line 15 and 18.
Line 15 and 16 looks fine, so as line 18.
In line 17 (bluewale, 25), it looks like we are inserting 2 values into a record.
However, the "bluewale" is a string doesn't surround by quote.
If we change line 17 into:
('bluewale', 25)
and run the code again, you get the result.
+ 1
Thank You. Now it's working
0
cmVxdWlyZSAiYmFzZTY0IgoKZW5jID0gQmFzZTY0LiBlbmNvZGU2NCggJ1NlbmQgcmVpbmZvcmNlbWVudHMnKQogICAgICAgICAgICAgICAgICAgICAjIC0+ICJVMlZ1WkNCeVpXbHVabTl5WTJWdFpXNTBjdz09XG4iCiBwbGFpbiA9IEJhc2U2NC4gZGVjb2RlNjQoIGVuYykKICAgICAgICAgICAgICAgICAgICAgIyAtPiAiU2VuZCByZWluZm9yY2VtZW50cyI=