Introduction to Oracle SQL Flashcards
Definition of a database
Set of data stored in a computer, usually structured in a way that makes data easily accessible.
RDBMS
Relational database management system is a program that allows you to create, update, and administer a relational database.
Most RDBMSs use the SQL language to access the database.
Relational database
is based on the relational model of data
PL/SQL
Procedural Language/SQL, or Oracle SQL, is Oracle’s implementation of SQL.
Advantages to Oracle SQL
It is great for working with large databases, easy to use, has well-written documentation, and supports amazing new features.
Disadvantages
Not open source
ERD
An ERD is a graphical representation of the relationships among different entities.
can help you model a real-world system
Entities
The entities are the things that form the basis of the real-world system and are transformed into tables in a database. This example ERD shows six entities and the relationships between them. (Customer, Invoice, InvoiceLine, Genre, Track, Album).
Relationship between two entities with example
A relationship between two entities signifies that they are associated with each other. For example, a track belongs to a certain album.
Attributes of Entity
Once you have established the entities and their relationships, you can enhance your ERD by adding attributes to each entity. For example, for each customer you might want to track the customer’s first and last name as well as contact information such as their address.
SQL
Structured Queried Language
industry-standard language that can be used to create databases, store data, change and analyze data, and get data back out.
Avoiding Duplicates
Use DISTINCT
Linking Columns
CONCATENATION
Comparison Operators
> , >=. <, <=, =, <>
Comparison keywords
BETWEEN, IN, LIKE
BETWEEN
Comparision keyword
SELECT Name, Milliseconds
FROM Track
WHERE Milliseconds BETWEEN 100000 AND 200000
IN
Comparison Keyword
To look for values in a list of values.
SELECT …
FROM …
WHERE EmployeeID IN (4, 5, 6)
LIKE
Compartision Keyword
When you don’t always know the exact value to search for
%
_
WHERE LastName LIKE ‘_a%’
LIKE %, _
% Represents any sequence of zero or more characters
_ Represents any single character