DAB102 SQL Data Manipulation PDF
Document Details
Uploaded by WondrousNewOrleans
St. Clair College
Tags
Summary
This document covers SQL queries for managing data within databases. It includes examples for INSERT, DELETE, and UPDATE statements, along with an introduction to different types of NoSQL databases. The document is a set of notes from a course in information management, with SQL related questions & exercise prompts, and example tables and data.
Full Transcript
What SQL querries can be used to manage data within a database? - INSERT -- Used to add a data record (row) to an existing table. - DELETE -- Deletes data from a table. - UPDATE -- Modifies an existing row of data. - SET -- Used with UPDATE to specify what to update. **Customers Table**...
What SQL querries can be used to manage data within a database? - INSERT -- Used to add a data record (row) to an existing table. - DELETE -- Deletes data from a table. - UPDATE -- Modifies an existing row of data. - SET -- Used with UPDATE to specify what to update. **Customers Table** **CustomerID** **CustomerName** **ContactName** **Address** **City** **PostalCode** **Country** ---------------- ---------------------- ----------------- ----------------------------- ---------- ---------------- ------------- 89 White Clover Markets Karl Jablonski 305 - 14th Ave. S. Suite 3B Seattle 98128 USA 90 Wilman Kala Matti Karttunen Keskuskatu 45 Helsinki 21240 Finland 91 Wolski Zbyszek ul. Filtrowa 68 Walla 01-012 Poland a. Create an SQL query that will insert the following data within the Customers table: b. Create an SQL query that deletes the customer "Wolski" from the Customers table: **DELETE FROM** Customers **WHERE** CustomerName=\'Wolski\'; c. Create an SQL query that updates the customer "White Clover Markets" address to Windsor, N8Y 2P9, Canada. 2. What is a NoSQL database and how does it store data ? - NoSQL is sometimes called "non-relational," because it does not organize data in tables consisting of columns and rows that conform to a structured schema. - Instead of tables, NoSQL data is stored in an unstructured or semi-structured format that makes database design simpler. 3. What are the 4 main types of NoSQL databases? ![](media/image2.png) ![](media/image4.png) - Key-value stores: stores just keys and a value for each key. Each key is unique. - Example: a session on a webiste, and all the data for that session. - Document databases: store documents in a machine-readable format such as JSON, BSON, or XML. These databases are not as efficient as relational databases for managing relationships between documents, but they are much more efficient at reading and searching documents. - Graph databases: store "nodes" that are connected to other "nodes" in a network. Graph databases are optimized to query these networks and navigate through the connections a lot faster and more efficiently than a relational database can join tables and find those relationships. - Example: A node can be a user in a social network who is connected to all their friends. - Wide Column Stores: store information in tables like relational databases, but the difference is that the columns are not attributes, they are values. These databases are designed to store these huge tables with "sparse" information in a very efficient way and retrieve it very quickly.