📚 Seth MB

Search

Search IconIcon to open search

Databases: SQL

Last updated May 26, 2023 Edit

# What is SQL?

Recap - Programming Language Hierarchy

1st generation: Binary/machine code

2nd generation: Assembly

3rd generation: Python/C/Java etc (most languages are here)

4th generation: SQL, HTML

4th generation languages expect you to describe a problem, and the language will deal with finding the solution to solve the problem. Whereas 3rd generation languages require you to describe the solution to a problem.

# Terminology Changes

When you move from the design phase to the actual database phase, some terminology needs to be changed.

Design PhaseActual Database
EntityTable or relation
AttributeField or column
InstanceRecord, tuple or row

The most commonly used words for each term are: table, field and record. Some people may use other terms.

Any terminology not listed in the above table will stay the same regardless.

# Using SQL

DDL is more for administrative purposes, whereas DML is more designed for users.

DDL contains very dangerous commands, such as DROP * in SQL, which would immediately delete everything.

Multiple databases may be hosted on the same DBMS, a hosting company may even host multiple different company’s data on a single DBMS. Therefore, giving DDL permissions to anyone who doesn’t absolutely require them and completely understand what they are doing is a very bad idea.

DDL commands will typically need to be tested on staging environments thoroughly before being run on live/production environments.

# Database Management Systems (DBMS)

Databases