SQL Basics | Shahul Hameed
SQL _Queries Resource: https://balanced-quince-db1.notion.site/SQL-7347f5956fe347f887b4132c716cd236#17bc403a1add453db519621da47c1de3 Database queries CREATE DATABASE LOGICFIRST; -- creates a new database -- TO DELETE A DATABASE DROP DATABASE LOGICFIRST; DROP SCHEMA LOGICFIRST; -- same as above. u can use DATABASE Or SCHEMA DROP SCHEMA IF EXISTS LOGICFIRST; -- prevents error if db not found SHOW DATABASES; -- shows all the databases SHOW SCHEMAS; -- same as above. shows schemas/db USE SYS; -- uses this database for all further commands SHOW TABLES;-- shows all tables in the database being used Table - Create,Delete,Alter primary key - uniquely identifies a row in a table //creating a table CREATE TABLE student( id INT PRIMARY KEY, name VARCHAR(30), gpa DECIMAL(3,2) ); -- ----or----- CREATE TABLE student( id INT, name VARCHAR(30), gpa DECIMAL(3,2), PRIMARY KEY(id) );