DML OPERATIONS: Data Manipulation Language is a one of the Subset of SQL. These SQL commands are used to store, modify, and delete data from database tables. In this category we have INSERT, UPDATE, and DELETE commands. Different DML statements are • Select • Insert • Update • Delete Select: The SELECT statement is used to select data from a database. The result is stored in a result table, called the result-set. The SELECT command is the most commonly used command in SQL. It allows database users to retrieve the specific information they desire from an operational database. Syntax: SELECT column_name(s) FROM table_name and SELECT * FROM table_name Example: consider the table student_details. To select the first name of all the students the query would be SELECT first_name FROM student_details; If we want to select all the columns from the table, we use the following SELECT statement: SELECT * FROM student_details; Insert: The ...
Popular posts from this blog
Table Relationships Before moving to the topic “Table Relationship”, we would have a look on the definition of Database, Table, Column and Row, as these entities participate in relationships. Database Database is an organized collection of data for fast processing on these data. These data are arranged in such form that enables fast retrieval of information and manipulation on these data. In RDBMSs, database organizes its data in relational form only using tables, column and rows. We can define relationships between these tables. Table A table is a collection of related data in a structured form using columns and rows within a database. It organizes its data using vertical columns and horizontal rows, intersection of a column and a row is known as a cell which stores the actual value in a table. Each column in a table has a unique name and no two columns of a table can have same name. A table have a defined number of columns with any number of rows. Rows can be ident...
Data Integrity In relational database management systems, data integrity ensures the accuracy, reliability and consistency of the data during any operation like as data manipulation, data retrieval, data storage, backup or restore operation etc. It also guarantees that the recording of data is accurate and as intended. Having any bad or unintended data in the database, is a failure of data integrity. For example, having sales detail in Sales table of a product not available in Product master is a failure of referential integrity. Below are few scenarios where we might require data integrity to accept and maintain valid, accurate and intended data in the database: We don’t have a NULL value as a product in Product master table. (Entity integrity) To ensure that we don’t have duplicate products in Product Master table. (Entity integrity) We don’t have any alphanumeric value in Amount column of Sales table. (Domain integrity) To ensure that Sales table doe...
Comments
Post a Comment