1. Understanding and Definitions of Database, RDBMS, entity, attributes, tables,
ID: 3733254 • Letter: 1
Question
1. Understanding and Definitions of Database, RDBMS, entity, attributes, tables, rows, columns 2. Understanding and Definitions of Primary key, Foreign Key 3. What is ER Diagram 4. What is CRUD 5. What are the limitations of spreadsheets as compared to database tables B) Structured Query Language (SQL) How to write SQL code for: 1. CREATE TABLE with PRIMARY KEY 2. DELETE rows 3. DELETE rows with WHERE clause 4. DROP TABLE 5. SELECT (general format) 6. SELECT with a WHERE clause 7. SELECT with aggregate 8. INSERTExplanation / Answer
Answer)
1) DATABASE: Database or relational database is a digital database which is based on relational model of data’s.
RDBMS: RDBMS is a software system which is used to maintain the relational databases.
Entity: Entity is defined as any object in the system which we want to model and store the information about.
Attributes: Columns in a database are otherwise referred to as attributes
Tables: It is a set of data elements /values which uses a model of columns and rows,where the cell are the unit where a row and column intersect.
Rows: A row is defined and also called as a record or tuple which represents a single, implicitly structured data item in a table.
Columns: a column is defined as a set of data values which are all of a single type in a table.
2) PRIMARY KEY: A primary key is defined as a special relational database table column or combination of columns that are designated to uniquely identify all the table records.
FOREIGN KEY: A foreign key is defined as a field or a collection of fields in a table which uniquely identifies a row of another table or the same table but always refers to the Primary key of the first table.
3) ER DIAGRAM: A ER Diagram or otherwise referred as entity-relationship diagram (ERD) is a data modelling technique which graphically describes an information system's entities and the relationships among those entities.
4) CRUD OPERATION: The expanded form of CRUD is create, read, update and delete. These represent the four basic functions of persistent storage. A CRUD application helps to retrieve and return the data from the database.
5) The limitation of Spread sheets as compared to database tables are:
Database provides a stable structure, controlling access permissions and user restrictions. This increases the efficiency and data consistency in databases.
When comes to data integrity database plays a better role as compared to the spread sheets in performance boosting and increasing the speed of the operations.
SQL Query:
1) CREATE TABLE Student (
ID int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Age int,
PRIMARY KEY (ID)
);
Here ID is the primary key and Student is the table's name
2) Delete from Student
OR Delete * from Student
To delete all the rows without deleting the table
3) DELETE FROM Student
WHERE ID=101;
4) DROP table Student;
5) Select * from Student;
6) Select * from Student where ID=101;
7) SELECT COUNT(ID), FirstName
FROM Student
GROUP BY ID;
8) INSERT INTO Student (ID, LastName, FirstName, Age)
VALUES (101, 'Erichsen', 'Skagen', 26);
NOTE : I have explicitly used "Student" as the table name and ID, LastName, FirstName and Age as the attributes.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.