To PostgreSQL
Essay
Earlier this week, I went to a seminar on Amazon AWS conducted by one of their partner organizations.
20
Essay
Earlier this week, I went to a seminar on Amazon AWS conducted by one of their partner organizations.
Note
Open the command prompt and type the below to connect the MySQL:
mysql -u username -pAfter the above command the command line will prompt you to enter the password and after entering the password you can query the database.
Note
The RETURNING INTO clause allows us to return column values for rows affected by DML statements. The returned data could be a single column, multiple columns or expressions.
INSERT INTO t1 VALUES (t1_seq.nextval, 'FOUR')
RETURNING id INTO l_id;Essay
Writings comments in the code will help you and anyone who reads the code by giving more readability and understandings...
Note
The TIMESTAMP datatype is an extension on the DATE datatype. In addition to the datetime elements of the DATE datatype, the TIMESTAMP datatype holds fractions of a second to a precision between zero and nine decimal places, the default being six. There are also two variants called TIMESTAMP WITH TIME ZONE and TIMESTAMP WITH LOCAL TIME ZONE. As their names imply, these timestamps also store time zone offset information.
create table table_name (
column_name number,
column_name2 timestamp default systimestamp);Note
To move a table to the recycle bin or remove it entirely from the database, you use the DROP TABLE statement:
DROP TABLE schema_name.table_name
[CASCADE CONSTRAINTS | PURGE];First, indicate the table and its schema that you want to drop after the DROP TABLE clause. If you don’t specify the schema name explicitly, the statement assumes that you are removing the table from your own schema.
Second, specify CASCADE CONSTRAINTS clause to remove all referential integrity constraints which refer to primary and unique keys in the table. In case such referential integrity constraints exist and you don’t use this clause, Oracle returns an error and stops removing the table.
Third, specify PURGE clause if you want to drop the table and release the space associated with it at once. By using the PURGE clause, Oracle will not place the table and its dependent objects into the recycle bin.
Note
Collation determines how strings are compared, which has a direct impact on ordering (sorting) and equality tests between strings.
There are two basic types of collation.
When using binary collations there are three suffixes that alter the behavior of sorts and comparisons.
If no collation is specified, directly or via a default setting, the default USING_NLS_COMP pseudo-collation is used, which means the NLS_SORT and NLS_COMP parameters are used to determine the actual collation used.
// Syntax
COLLATE BINARY_CS / BINARY_CI / BINARY_AI
column_name VARCHAR2(15 CHAR) COLLATE BINARY_CI
create table (...) DEFAULT COLLATION BINARY_CI;
ALTER TABLE t1 DEFAULT COLLATION BINARY_AI;Note
The NLS_DATABASE_PARAMETERS shows the values of the NLS parameters for the database. Oracle notes these differences between the parameters.
NLS_SESSION_PARAMETERS shows the NLS parameters and their values for the session that is querying the view. It does not show information about the character set.NLS_INSTANCE_PARAMETERS shows the current NLS instance parameters that have been explicitly set and the values of the NLS instance parameters.NLS_DATABASE_PARAMETERS shows the values of the NLS parameters for the database. The values are stored in the database.SELECT * FROM NLS_SESSION_PARAMETERS ORDER BY 1;
SELECT * FROM NLS_INSTANCE_PARAMETERS ORDER BY 1;
SELECT * FROM NLS_DATABASE_PARAMETERS ORDER BY 1; The NLS_LANGUAGE and NLS_TERRITORY values in NLS_DATABASE_PARAMETERS cannot be changed once the database has been created
Note
A database management system (DBMS) is software that controls the storage, organization, and retrieval of data.
Typically, a DBMS has the following elements:
Kernel code
This code manages memory and storage for the DBMS.
Repository of metadata
This repository is usually called a data dictionary.
Query language
This language enables applications to access the data.
A database application is a software program that interacts with a database to access and manipulate data.
The first generation of database management systems included the following types:
Hierarchical
A hierarchical database organizes data in a tree structure. Each parent record has one or more child records, similar to the structure of a file system.
Network
A network database is similar to a hierarchical database, except records have a many-to-many rather than a one-to-many relationship.
Note
In his seminal 1970 paper “A Relational Model of Data for Large Shared Data Banks,” E. F. Codd defined a relational model based on mathematical set theory. Today, the most widely accepted database model is the relational model.
A relational database is a database that conforms to the relational model. The relational model has the following major aspects:
Structures
Well-defined objects store or access the data of a database.
Operations
Clearly defined actions enable applications to manipulate the data and structures of a database.
Integrity rules
Integrity rules govern operations on the data and structures of a database.
A relational database stores data in a set of simple relations. A relation is a set of tuples (rows). A tuple is an unordered set of attribute (columns) values.
A table is a two-dimensional representation of a relation in the form of rows (tuples) and columns (attributes). Each row in a table has the same set of columns. A relational database is a database that stores data in relations (tables). For example, a relational database could store information about company employees in an employee table, a department table, and a salary table.