Define Databases
structures collection of data that allows people to extract information in a way that mees their needs
Define single-table databases
a database that contains only one table
Define table
a collection of related records in a database
Define record
a collection of fields that describe one item
Define field
a column in a database- a specific type of information under a category
define datatype [2]
the way a data is stored or displayed
- it also defines the operations that can be performed on the stored value
What is Text/alphanumeric as a datatype
A number of characters
What is Character as a datatype
a single character
What is Integer as a datatype
whole number
What is boolean as a datatype
One of the two values: true/false yes/no 0/1
What is float/real as a datatype
a decimal number
What is Date/Time as a datatype
Date and/or Time
Define Primary key
a field that uniquely identifies the record
Define SQL
Structured Query Language- to write scripts to get information from a database.
What does SQL- SELECT do? [2]
fetches specified fields- all queries begin with select
What does SQL- FROM do?
Identifies the table to use
What does SQL- WHERE do?
Includes only records (rows) that match the given condition
What does SQL- ORDER BY do?
Sorts results from query (numerically or alphabetically)
What does SQL- SUM do?
returns the sum of all values in a field
What does SQL- COUNT do?
Counts number of records where the field matches give condition.
SQL script- creating databases
create database <database_name>;</database_name>
SQL script- creating table
create table <table_name>(
field1name datatype (memory aloc),
field2name, datatype (memory aloc),
field3name datatype (memory aloc
);</table_name>
SQL script- Inserting data into table
insert into <table_name> (field1, field2, field3)
Values
(value1, value2, value3)
(value1, value2, value3);</table_name>
SQL script- Select everything in table
Select*from <table_name></table_name>