Lecture 5 Flashcards
What is a databas
A database is an organized collection of structured information, or data, typically stored electronically in a computer system.
Example of SQL databse
MySQL,
PostgreSQL,
Oracle,
MS-SQL Server
Example of NoSQL database
MongoDB,
GraphQL,
HBase,
Neo4j,
Cassandra
What is database normalization
Normalization is a database design technique that reduces data redundancy and eliminates undesirable characteristics like Insertion, Update and Deletion Anomalies.
Normalization rules divides larger tables into smaller tables and links them using relationships.
What is SQL
Structured Query langauge is a programming language used by nearly all relational databases to query, manipulate, and define data, and to provide access control.
Describe DDL
DDL stands for Data Definition Language. The DDL commands help to define the structure of the databases or schema.
Mention some commands
CREATE: It is used to create a new database and its objects such as table, views, function, stored procedure, triggers, etc.
DROP: It is used to delete the database and its objects, including structures, from the server permanently.
ALTER: It’s used to update the database structure by modifying the characteristics of an existing attribute or adding new attributes.
RENAME: This command renames the content in the database.
Syntax to create a database
CREATEDATABASEdatabasename;
CREATE DATABASE pauCafe;
Syntax to drop database
DROP DATABASE databasename;
DROP DATABASE pauCafe;
Syntax to drop table
DROP TABLE table_name;
Synxtax to alter table
ALTER TABLE Students
ADD Email varchar(255);
Syntax to rename statement
ALTER TABLE table_name
RENAME TO new_table_name;
Describe DML
Data Manipulation Language. The DML commands deal with the manipulation of existing records of a database.
Mention some DML commmands
SELECT: This command is used to extract information from a table.
INSERT: It is a SQL query that allows us to add data into a table’s row.
UPDATE: This command is used to alter or modify the contents of a table.
DELETE: This command is used to delete records from a database table, either individually or in groups.
Syntax for select comand
SELECT column1, column2, …
FROM table_name;