Content pfp
Content
@
0 reply
0 recast
0 reaction

Hardik Harsh pfp
Hardik Harsh
@hardikharsh10
So I started learning SQL so that I can eventually use Dune better. Here are some commands that I learned: • 'CREATE' statements allow us to create a new table in the database. You can use the 'CREATE' statement anytime you want to create a new table from scratch.  • The 'INSERT' statement inserts a new row into a table. • 'SELECT' statements are used to fetch data from a database. 'SELECT' statements always return a new table called the result set. • The 'ALTER TABLE' statement adds a new column to a table. • The 'UPDATE' statement edits a row in a table. You can use the 'UPDATE' statement when you want to change existing records. • The 'DELETE FROM' statement deletes one or more rows from a table. You can use the statement when you want to delete existing records. • 'IS NULL' is a condition in SQL that returns true when the value is NULL and false otherwise
1 reply
0 recast
2 reactions

Hardik Harsh pfp
Hardik Harsh
@hardikharsh10
• 'PRIMARY KEY' columns can be used to uniquely identify the row. Attempts to insert a row with an identical value to a row already in the table will result in a constraint violation which will not allow you to insert the new row. • 'UNIQUE' columns have a different value for every row. This is similar to 'PRIMARY KEY' except a table can have many different 'UNIQUE' columns. • 'NOT NULL' columns must have a value. Attempts to insert a row without a value for a 'NOT NULL' column will result in a constraint violation and the new row will not be inserted. • DEFAULT columns take an additional argument that will be the assumed value for an inserted row if the new row does not specify a value for that column.
0 reply
0 recast
0 reaction