SQL Flashcards
What does SQL stand for?
Structured Query Language
What is a database?
A structured way to store data which can be retrieved using queries
What is the name for a row of data in a table?
Record
What is the name for a single attribute of a data in a table?
Field
What are the different data types in a database?
Integer
Real
Date
Time
DateTime
Char
Varchar
Text
What is a flat file database?
A database stored in a single text file
Often stored using a CSV file, or comma separated values
What is one advantage and disadvantage of a flat file database?
It is easy to set up, but is hard to use for anything but the simplest of data sets.
What is a primary key?
A primary key is a unique field for that specific table
What is redundancy in a database?
Two records store the same data
What is inconsistency in a database?
Information is incorrect or labelled differently
What is a relational database?
A database that stores multiple tables that have relations between them
What is a foreign key?
A field in a table that references the primary key of another table.
Write a query in SQL to select all fields from the database “dogs “ that are called “Chip”.
SELECT * FROM dogs WHERE name = “Chip”