Karteikarten
SQL 1

Karten in diesem Stapel (20)
- 1Open up SQL command line.root@goorm:/workspace/aaa# mysql-ctl cli
- 2How to clear a querry in the terminal\c
- 3- Having a list of databases - Creating a database - Dropping a DB - Using a DB - To check which DB we're using- SHOW DATABASES;
- CREATE DATABASE db_name;
- DROP DATABASE db_name;
- USE db_name;
- SELECT database(); - 4Numeric types :• INT
• SMALLINT
• TINYINT
• MEDIUMINT
• BIGINT
• DECIMAL
• NUMERIC
• FLOAT
• DOUBLE
• BIT - 5String types• CHAR
• VARCHAR
• BINARY
• VARBINARY
• BLOB
• TINYBLOB
• MEDIUMBLOB
• LONGBLOB
• TEXT
• TINYTEXT
• MEDIUMTEXT
• LONGTEXT
• ENUM - 6Date types• DATE
• DATETIME
• TIMESTAMP
• TIME
• YEAR - 7- Max INT signed and unsignedINT is by default signed, INT (which is shorthand for INT SIGNED) therefore has the MAX VALUE of 2147483647. INT UNSIGNED is 0 to 4294967295.
- 8- VARCHAR - CHARVARCHAR : A variable-Length string between 1 and 255 characters.
CHAR : A fixed-length string. - 9- Creating a TABLE - Verifying it worksSHOW TABLES;
OR
SHOW COLUMNS FROM ;
OR
DESC ;
- 10Deleting a tableDROP ;
- 11Simple insert

- 12Multiple insert

- 13- Null definition - How do we require a value cannot be null ?- Null means the value is unknown. (not egal zero !)

- 14Setting Default Values

- 15- Getting everything from a table - One column - Many columns

- 16Changing the title of a column

- 17To update values

- 18To delete something in particular :Cats named Egg will be removed from the table.
Note : IDs will remain the same !
- 19To delete everything in the table :DELETE FROM cats;
- 20—
Informationen
- Beschreibung
- vaze SQL Karteikarten am SQL 1, erstellt von dadou siplancin am 14/02/2022.
- Erstellt von
- dadou siplancin
- Aufrufe
- 0
- Bewertung