In the upcoming videos we are going to discuss data types in depth, but I don't want to drown you in all of the details. Because of that, I'm giving you this video which is going to introduce you to the most important data types. Then, in the upcoming videos, I'll describe them in more depth.
One of the data types we've already discussed in this video is NUMBER. This data type is used to, obviously, store a number. It can be used to store integers (whole numbers), or numbers with decimals. There are two other numeric data types you should know of.
BINARY_FLOAT and BINARY_DOUBLE are both numeric data types that are known as floating point numbers. A floating point number is often used for large numbers that have decimal places where it is acceptable to not be completely precise. What I mean by this is that these numbers can only store numbers correctly up to a certain decimal point. If you need perfect precision, you will want to use the NUMBER data type.
Now storing numbers is good sometimes, but occasionally you will want to store string data. String data can be any sequence of characters, including numbers. By telling the database that a column is a string data type, the database knows how to treat that column. There are four important string data types that you need to know about.
The first two are CHAR and NCHAR. These data types are used to store a fixed-length string. So for example, you can say you want to store 12 characters. This means that every value for this column will be exactly 12 characters. If you insert less than 12 characters, the data will be padded with spaces. This means you will want to use one of these data types when every value in the column is the same length. What is the difference between CHAR and NCHAR? CHAR uses what is known as ASCII while NCHAR uses Unicode. The difference is what characters are allowed and how much space each character takes. ASCII takes up less space but only supports English, numbers, and some symbols. UNICODE allows you to store characters from multiple languages but takes up more space.
Those were both fixed-length string. What if you want to store data that changes in length? That is where VARCHAR2 and NVARCHAR2 come in.
When it comes to storing dates, the data types that are most important are DATE and TIMESTAMP. Date can be used to store dates and time. Timestamp is a data type that can be used to store an exact moment in time.
Lastly, there are interval types. These store a date range.
Support me! http://www.patreon.com/calebcurry
Subscribe to my newsletter: http://bit.ly/JoinCCNewsletter
More content: http://CalebCurry.com
Amazing Web Hosting - http://bit.ly/ccbluehost (The best web hosting for a cheap price!)
A trigger is a named PL/SQL unit that is stored in the database and executed ( fired ) in response to a specified event that occurs in the database.
Overview of Triggers.
A trigger is a named program unit that is stored in the database and fired (executed) in response to a specified event. The specified event is associated with either a table, a view, a schema, or the database, and it is one of the following:
A database manipulation (DML) statement ( DELETE , INSERT , or UPDATE )
A database definition (DDL) statement ( CREATE , ALTER , or DROP )
A database operation ( SERVERERROR , LOGON , LOGOFF , STARTUP , or SHUTDOWN )
The trigger is said to be defined on the table, view, schema, or database.
A DML trigger is fired by a DML statement, a DDL trigger is fired by a DDL statement, a DELETE trigger is fired by a DELETE statement, and so on.
An INSTEAD OF trigger is a DML trigger that is defined on a view (not a table). The database fires the INSTEAD OF trigger instead of executing the triggering DML statement. For more information, see Modifying Complex Views (INSTEAD OF Triggers).
A system trigger is defined on a schema or the database. A trigger defined on a schema fires for each event associated with the owner of the schema (the current user). A trigger defined on a database fires for each event associated with all users.
A simple trigger can fire at exactly one of the following timing points :
Before the triggering statement executes.
After the triggering statement executes.
Before each row that the triggering statement affects.
After each row that the triggering statement affects.
A compound trigger can fire at more than one timing point. Compound triggers make it easier to program an approach where you want the actions you implement for the various timing points to share common data. For more information, see Compound Triggers.