-
-
Save amirrajabi/45d7a4f61e873a9b0d07 to your computer and use it in GitHub Desktop.
SQL Commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----------------------------- SQL ------------------------ | |
# SELECT * | |
# FROM movies | |
# WHERE ganre = "Horrer" | |
# ORDER BY duration; | |
# ORDER BY duration DESC; | |
# WHERE duration > 100; >= <= = > < <> | |
# AND | |
# OR | |
# INSERT INTO movies (id, title, genre, duration) | |
# VALUES (5, 'The Circus', 'Comedy', 71) | |
# UPDATE movies | |
# SET item = new | |
# WHERE item = old | |
# UPDATE concessions | |
# SET item = 'Hamburger' | |
# WHERE item = 'Pizza'; | |
# UPDATE concessions | |
# SET price = '1.00' | |
# WHERE item = 'Popcorn' OR item='Candy'; | |
# DELETE FROM | |
# WHERE item = old | |
# CREATE DATABASE -----; | |
# DROP DATABASE -----; | |
# DROP TABLE -----; | |
# CREATE TABLE MOVIES | |
# ( | |
# id int, | |
# genre varchar(15), | |
# column_name datatype | |
# ); | |
# CREATE TABLE advertisements | |
# ( | |
# id int, | |
# title varchar(10), | |
# type varchar(10), | |
# price int | |
# ); | |
# | |
# INSERT INTO advertisements (id, title, type, price) | |
# VALUES (1, 'Poster', 'Paper', 20); | |
# ALTER TABLE movies | |
# ADD COLUMN ratings | |
# UPDATE concessions | |
# SET ratings = 9 | |
# WHERE item = 'The wine'; | |
# ALTER TABLE movies | |
# DROP COLUMN ratings; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment