Podcast
Questions and Answers
Which of the following best describes the primary function of a database?
Which of the following best describes the primary function of a database?
- To execute complex mathematical calculations.
- To design graphical user interfaces.
- To encrypt and decrypt secure communications.
- To collect, organize, and manage information. (correct)
In the context of databases, what does the term 'schema' refer to?
In the context of databases, what does the term 'schema' refer to?
- The physical hardware on which the database is stored.
- A visual representation of data.
- An algorithm used for data encryption.
- A blueprint or structure that defines how data is organized within a database. (correct)
Why might a company choose to use a database instead of a simple spreadsheet for managing its data?
Why might a company choose to use a database instead of a simple spreadsheet for managing its data?
- Spreadsheets are specifically designed for complex data modeling.
- Databases have limited support for complex queries.
- Databases can handle larger volumes of data more efficiently and reduce redundancy. (correct)
- Spreadsheets offer better security features.
Which of the following is an example of a File Database?
Which of the following is an example of a File Database?
Which of the following is a key advantage of using application databases over file databases when dealing with large datasets?
Which of the following is a key advantage of using application databases over file databases when dealing with large datasets?
Which of the following is an example of an open-source database management system?
Which of the following is an example of an open-source database management system?
In database structure, how are tables related to fields?
In database structure, how are tables related to fields?
In the context of databases, what is a 'field'?
In the context of databases, what is a 'field'?
Consider a database named 'University' with tables for 'Students,' 'Courses,' and 'Instructors.' Which of the following SQL statements would retrieve all student's names?
Consider a database named 'University' with tables for 'Students,' 'Courses,' and 'Instructors.' Which of the following SQL statements would retrieve all student's names?
What is the primary purpose of SQL (Structured Query Language)?
What is the primary purpose of SQL (Structured Query Language)?
Which SQL clause is used to filter the results of a query based on a specified condition?
Which SQL clause is used to filter the results of a query based on a specified condition?
Which SQL statement is used to add new data to a database table?
Which SQL statement is used to add new data to a database table?
What is the purpose of the SQL UPDATE
statement?
What is the purpose of the SQL UPDATE
statement?
Which SQL aggregate function calculates the average value of a numeric column?
Which SQL aggregate function calculates the average value of a numeric column?
What does the SQL DISTINCT
keyword do?
What does the SQL DISTINCT
keyword do?
Which of the following components is typically included in a relational database?
Which of the following components is typically included in a relational database?
What is 'referential integrity' in the context of relational databases?
What is 'referential integrity' in the context of relational databases?
In a relational database, what is a 'database key' used for?
In a relational database, what is a 'database key' used for?
What is the significance of 'minimizing redundancy' in relational database design?
What is the significance of 'minimizing redundancy' in relational database design?
Consider a database storing customer orders. If each table stores a distinct kind of information, how would these tables be related?
Consider a database storing customer orders. If each table stores a distinct kind of information, how would these tables be related?
Flashcards
What is a database?
What is a database?
A tool for collecting and organizing information; an organized collection of data.
What can databases store?
What can databases store?
Databases can store information about people, products, orders, or really anything else.
What can be used instead of a database?
What can be used instead of a database?
Databases are replacements for disorganized lists in programs like word processors or spreadsheets.
Types of Database Storage
Types of Database Storage
Signup and view all the flashcards
What is SQLite3?
What is SQLite3?
Signup and view all the flashcards
File vs Application databases
File vs Application databases
Signup and view all the flashcards
Examples of Server databases
Examples of Server databases
Signup and view all the flashcards
Database structure hierarchy
Database structure hierarchy
Signup and view all the flashcards
What is SQL?
What is SQL?
Signup and view all the flashcards
SQL SELECT/FROM
SQL SELECT/FROM
Signup and view all the flashcards
SQL WHERE/ORDER
SQL WHERE/ORDER
Signup and view all the flashcards
SQL INSERT/DELETE/UPDATE
SQL INSERT/DELETE/UPDATE
Signup and view all the flashcards
SQL Aggregate functions
SQL Aggregate functions
Signup and view all the flashcards
Relational database
Relational database
Signup and view all the flashcards
Study Notes
- A database is a tool for collecting and organizing information.
- A database is an organized collection of data including schemes, tables, queries, reports, views, and other objects.
- Data is typically organized to model aspects of reality, such as availability of hotel rooms for finding a hotel with vacancies.
- Databases can store information about people, products, orders, or anything else.
- Companies with huge amounts of data need databases to easily manipulate them.
- Many databases start as a list in a word-processing program or spreadsheet.
- As lists grow, redundancies and inconsistencies appear, making the data hard to understand and limiting search capabilities.
- There are 2 types of database storage which are via file database and via application database.
File Database
- Data is saved in a file and accessed through special libraries.
- SQLite3 has a connection library that is already in Python
- The most used type of database is SQLite3 because it is stored in every iPhone and Android device.
- File databases can be easily moved from one computer to another.
Application Databases
- A server database is a program that manages data
- All queries and requests are performed by that program.
- Application databases can be faster than file databases for big data.
- Examples include:
- Oracle- the Mostly used commercial database.
- MySQL, which is an open source
- MSSQL developed by Microsoft
- PostgreSQL, an open-source database, is 5th most popular
Database Structure
- Databases are designed for storing, managing, and retrieving information.
- A server stores data in many databases which in turn store tables.
- Tables are constructed by fields which stores each row of data.
- Fields are classified by their data type, such as:
- Integer
- String
- Date
- Datetime
- Boolean
The Tables
- For example, in the MySDU database the tables are students, course, and teachers
- The fields are:
- Name (string/varchar)
- Surname (string/varchar)
- Age (integer)
SQL (Structured Query Language)
- SQL is a special language to retrieve, update, and delete data from a database.
- A SQL request is written in code that is send to a SQL server, and the response is then retrieved.
SQL Data Retrieving Example
SELECT name, surname FROM contacts WHERE name = 'John' ORDER BY surname
retrieves the name and surname fields from the contacts table where the name is John(filtering) and the output is sorted alphabetically (ordering) by surname.SELECT *
: uses the asterisk to output all fields.
SQL (Insert, Delete, Update)
INSERT INTO students (name, surname) values (‘Berik,'Sakenov')
inserts a new student.DELETE FROM students WHERE name = 'Berik'
deletes the student with the name Berik.UPDATE students SET name='Serik' WHERE name='Berik'
updates a student's name from Berik to Serik.
SQL Aggregate Functions
SELECT COUNT(*) FROM users
counts the number of users.SELECT MIN(age) FROM users
finds the minimum age among users.SELECT AVG(age) FROM users
calculates the average age of users.SELECT DISTINCT(surname) FROM users
selects and lists unique surnames from the users.
Using MySQL
- Install XAMPP for Foundations of web class
- Enter in browser localhost/phpmyadmin
- Links:
Relational Database
- System of related tables
- Minimum redundancy
- Referential integrity
- Database keys
- Relational databases store information in atomic tables
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.