Enterprise: Week 2 Flashcards
What is SQL?
SQL Stand for Structured Query Language
What does SQL do?
t is a domain-specific language for working with certain databases called relational databases.
Is SQL a programming language?
SQL is not a programming language, although there are extensions to the specification like PL/SQL that add familiar programming constructs.
Instead, it is an English-like syntax that lets developers and database administrators abstract away the process of manipulating data and focus on the WHAT instead of HOW in the database.
What is a Relational Database?
A relational database is a type of database that stores information in tables - that is, the data is stored in rows and columns, similar to a spreadsheet.
What is each row in the table?
Each row in the table is a record, and each record has properties which correspond to the different columns in the table.
What type of software is used to manipulate a database?
relational database management system, or RDBMS
Is there a difference between relational databases and non-relational databases?
There are major differences. Nonrelational databases do not store data within tables that relate to each other, and thus do not use SQL to interact with the database.
What type of data provides meaning to an enterprise?
Related data is what provides meaning and organizes the structure of data.
Normally where is relational databases used in?
OLTP (online transaction processing) environment, which means the idea of having related data is preferable in a very transactional system and that are normally row-based
For non-transactional environments, what is used?
OLAP - Online analytic processing: normally columnar-based, which is faster for reading but slower for manipulation
How many zones does AWS span out to?
77 available zones within 24 geographic regions around the world
What are AWS regions?
An AWS region is a geographical location with a collection of availability zones mapped to physical data centers in that region. Every region is physically isolated from and independent of every other region in terms of location, power, water supply, etc.
Why is this level of isolation important for AWS regions?
This level of isolation is critical for workloads with compliance and data sovereignty requirements where guarantees must be made that user data does not leave a particular geographic region.
Why is the presence of AWS regions also important?
The presence of AWS regions worldwide is also important for workloads that are latency-sensitive and need to be located near users in a particular geographic area.
What is an Availability Zone?
An availability zone is a logical data center in a region available for use by any AWS customer.
What does each zone contain?
Each zone in a region has redundant and separate power, networking and connectivity to reduce the likelihood of two zones failing simultaneously.
What is Amazon RDS?
Amazon Relational Database Service (Amazon RDS) is a web service that makes it easier to set up, operate, and scale a relational database in the AWS Cloud.
What does Amazon RDS provide?
It provides cost-efficient, resizable capacity for an industry-standard relational database and manages common database administration tasks.
What does RDS automate?
RDS automates expensive and time consuming tasks such as managing backups, software patching, automatic failure detection, and recovery.
What does RDS help control?
You can help control who can access your RDS databases by using AWS Identity and Access Management (IAM) to define users and permissions.
RDS is available on several database instance types. What do instance types comprise of?
Instance types comprise varying combinations of CPU, memory, storage, and networking capacity and give you the flexibility to choose the appropriate mix of resources for your database.
What 6 database engines does the RDS provide?
Amazon Aurora, PostgreSQL, MySQL, MariaDB, Oracle Database, and SQL Server.
Why use RDS?
- AWS offers 15 database engines including relational, key-value, document, in-memory, graph, time series, and ledger databases.
- Don’t need to worry about database mgmt tasks such as backups, recovery, configurations. It is managed by RDS
- RDS is a relational database service, organizes data within tables in rows and columns
What are availability zones (AZs)?
distinct locations in AWS Regions
How is each availability zone engineered?
To be isolated from failures in other Availability Zones. Each is engineered to provide inexpensive, low-latency network connectivity to other Availability Zones in the same AWS Region.
What is Fault Tolerance?
Fault-tolerance defines the ability for a system to remain in operation even if some of the components used to build the system fail.
What does the security group do?
A security group controls the access to a DB instance. It does so by allowing access to IP address ranges or Amazon EC2 instances that you specify. ou can set security groups when configuring your RDS instance.
What are the 3 ways of interacting with Amazon RDS?
AWS Management Console, Command Line Interface, Programatically Accessing Amazon RDS
What are some key differences between AWS RDS and AWS EC2 Instance?
- DB services (like RDS) are managed services, meaning that you have limited control over the actual database. EC2 (Elastic Cloud Compute), gives you maximum control over the software stack, db, and operating system
- EC2 allows you to compute capacity and SUPER privileges, increasing flexibility
- RDS is more cost-effective and is automated, but limits control over the DB
- RDS takes care of your DB from end-to-end by managing, maintaining, and securing it, eliminiating overhead costs and the role of a DBA
What is Cloud computing?
Cloud computing is the on-demand delivery of compute power, database storage, applications and other IT resources through a cloud services platform via the Internet with pay-as-you-go pricing.
What does cloud computing provide?
Provides a simple way to access servers, storage, databases and a broad set of application services over the Internet.
What are the 6 advantages of cloud computing?
- Trade capital expense for variable expense.
- Benefit from massive economies of scale.
- Stop guessing about capacity.
- Increase speed and agility.
- Eliminate overhead cost of maintaining data centers
- Go global in minutes.
What is Trade Capital Expense for Variable Expense?
Instead of having to invest heavily in data centers and servers before you know how you’re going to use them, you can pay only when you consume computing resources, and pay only for how much you consume.
What is Benefit from Massive Economics of Scale?
By using cloud computing, you can achieve a lower variable cost than you can get on your own. Because usage from hundreds of thousands of customers is aggregated in the cloud, providers such as AWS can achieve higher economies of scale, which translates into lower pay as-you-go price.
What is Stop guessing about capacity?
Eliminate guessing on your infrastructure capacity needs. When you make a capacity decision prior to deploying an application, you often end up either sitting on expensive idle resources or dealing with limited capacity.
What is Increase speed and agility?
In a cloud computing environment, new IT resources are only a click away, which means that you reduce the time to make those resources available to your developers from weeks to just minutes.
What is Eliminate overhead cost of maintaining data centers?
Cloud computing lets you focus on your own customers, rather than on the heavy lifting of racking, stacking, and powering servers (infrastructure).
What is Go global in minutes?
Easily deploy your application in multiple regions around the world with just a few clicks. This means you can provide lower latency and a better experience for your customers at minimal cost.
What are the 3 models of cloud computing?
IaaS, Paas, Saas
What is Iaas?
Infrastructure as a Service (IaaS) is a self-service model for managing remote data center infrastructures. AWS offers IaaS in the form of data centers.
What is PaaS?
Platform as a Service (PaaS) allows organizations to build, run and manage applications without the IT infrastructure. This makes it easier and faster to develop, test and deploy applications.
What is SaaS?
Software as a service (SaaS) replaces the traditional on-device software with software that is licensed on a subscription basis. It is centrally hosted in the cloud. A good example is Salesforce.com.
What are the common data types in SQL?
Numeric, Date/Time, Character/String, Binary, Misc.
What is the convention for SQL?
SQL is a case-insensitive language, but the convention is to use UPPERCASE to refer to SQL keywords and lowercase for non-SQL specific entities (like table or column names). This helps distinguish between SQL keywords and other words.
Also, for readability purposes we should split long commands or queries into multiple lines.
What is DML?
Data Manipulation Language statements are used to perform CRUD operations on the actual data. Operations are normally performed by row in a relational database.
What is INSERT?
INSERT, to insert a new row into a table.
INSERT INTO TABLE_NAME VALUES (V1, V2, …, VN)
INSERT INTO TABLE_NAME (C1, C2, C3) VALUES (V1, V2, V3)
What is UPDATE?
UPDATE, to update one or more rows column values of a table that match a specific WHERE clause.
UPDATE TABLE_NAME SET C1 = V1, … , CN = VN WHERE X = Y
What is DELETE?
DELETE, to delete one or more rows of a table that match a specific WHERE clause.
DELETE TABLE_NAME WHERE [condition]
What is SELECT?
SELECT, to obtain one or more rows of a table that match a specific WHERE clause. In ORACLE databases this one is considered DML. This is how we perform queries in a database.
SELECT C1, …, CN FROM TABLE_NAME [table] WHERE [condition] GROUP BY [expression]
HAVING [condition] ORDER BY table.field
What is DQL?
Data Query Language, not really a sub-language within Oracle databases, is the sub language where only the SELECT statement exists.
What are DQL Clauses?
The GROUP BY clause will combine all rows by a column specified in a query and perform any aggregate functions which are stated.
SELECT NAME, COUNT(NAME) FROM STUDENT GROUP BY (NAME)
The HAVING clause will pass another filter similar to the WHERE clause after everything has been filtered and grouped.
SELECT NAME, COUNT(NAME) FROM STUDENT GROUP BY (NAME) HAVING COUNT(NAME) > 5;
**If you try to perform this HAVING clause in a WHERE clause, a SQL error will be thrown, and it makes sense - the RDBMS doesn’t want you to perform an aggregate function combining all rows, per each row. It’s a performance safety measure.
What are Scalar Functions?
Scalar functions operate on individual values and will perform some operation per row, and can be used in the SELECT or WHERE clause.
TO_CHAR(DATE,’DATE_FORMAT’)
TO_DATE(DATE,’DATE_FORMAT’)
UPPER(‘VALUE’)
LOWER(‘VALUE’)
To write them in a query:
SELECT UPPER(NAME) FROM STUDENT; SELECT NAME FROM STUDENT WHERE UPPER(NAME) LIKE 'P%'.
What are Aggregate Functions?
Aggregate functions operate on multiple values (multiple rows). These functions are used to combine (aggregate) the values existing in one column.
These functions are used in the SELECT clause. They can’t be used in the WHERE clause.
If there is more than one column being selected in the SELECT column section of a query which is not aggregating, a GROUP BY clause is required.
In order to perform similar WHERE clause Boolean operations with aggregate functions, the HAVING clause can be used.
What is MAX(COLUMN)?
Returns the max value on a column
What is MIN(COLUMN)?
Returns the minimum value on a column
What is AVG(COLUMN)?
Returns the average value of the column