Home
Search results “Oracle drop if exists”
CHECKING IF EXISTS IN SQL SERVER
 
13:39
This video for the beginner of SQL server programmer who are not fully understand how to checking if data exists do the correct condition and if data not exists do other transaction
Views: 13892 Sourn Sarim
The SQL EXISTS clause
 
08:52
How to use the EXISTS clause in SQL. For beginners.
Views: 22108 Database by Doug
SQL Server Temp Tables - TSQL Command Line  with  IF EXISTS and  DROP TABLE
 
09:34
Discussion of Temp Tables and persistence and why IF EXISTS and DROP TABLE are not necessary. Temp Tables are created in the tempdb system database in SQL Server. They are persistent but not necessarily long lived. Temp tables hav many similarities to true tables, however they also have special properties that allow more flexibility respecting scope.
Views: 1809 Dave Merton
SQL Error ORA-00942 Table or View Does Not Exist in Oracle Database
 
05:03
How to use Tab View (Data Dictionary) of Oracle Database to solve the SQL Error ORA-00942 Table or View Does Not Exist error in Oracle Database ------------------------------------------------------------------------ ►►►LINKS◄◄◄ Blog: http://bit.ly/ora-00942 Previous Tutorial ► ------------------------------------------------------------------------- ►Make sure you SUBSCRIBE and be the 1st one to see my videos! ------------------------------------------------------------------------- ►►►Find me on Social Media◄◄◄ Follow What I am up to as it happens on https://twitter.com/rebellionrider http://instagram.com/rebellionrider https://plus.google.com/+Rebellionrider http://in.linkedin.com/in/mannbhardwaj/ ___Facebook Official Page of Manish Sharma___ https://www.facebook.com/TheRebellionRider/ ___Facebook Official Page of RebellionRider.com___ https://www.facebook.com/RebellionRider.official/ You can also Email me at for E-mail address please check the About section Please please LIKE and SHARE my videos it makes me happy. Thanks for liking, commenting, sharing and watching more of our videos This is Manish from RebellionRider.com ♥ I LOVE ALL MY VIEWERS AND SUBSCRIBERS
Views: 5995 Manish Sharma
Check Last Modified DateTime for An Object (Table,Stored Procedure,Trigger etc.) in SQL Server
 
04:23
We as SQL Server developers send our DDL Scripts ( Add New Column, Drop some column from table, or Alter Stored Procedure) to DBA. After deployment we verify those changes and sometime it happens that the changes are not done. Maybe DBA has missed one of the script to run. If we can get the last modified date for object ( Table,Stored Procedure, View etc) that can confirm the changes are done on given date. blog post link for scripts used in this video http://sqlage.blogspot.com/2014/01/tsql-how-to-check-when-object-table.html
Views: 7063 TechBrothersIT
MSSQL   Check if index exists and if exists delete it
 
01:57
More: http://howtodomssqlcsharpexcelaccess.blogspot.ca/2016/02/mssql-check-if-index-exists-and-if.html
Views: 446 Vis Dotnet
Oracle Database11g tutorials 16: How to uninstall oracle 11g from windows 7 64 bit
 
08:49
How To Properly Uninstall oracle database 11g from windows 7 and 8 manually without formatting your Computer By Manish Sharma Rebellion Rider Blog Link http://bit.ly/uninstall-oracle-11g-from-win-7 Website: www.RebellionRider.com Manual Un-Installation of Oracle Database 11g. This video will show you proper process on uninstalling Oracle database 11g from windows 7 64 bit. How to uninstall oracle 11g on windows 7 / How to uninstall oracle 10g on windows 7 Read How to uninstall oracle 11g on windows http://www.rebellionrider.com/how-to-uninstall-oracle-database-11g-from-windows-7.html YouTube Video on How to create database http://bit.ly/create-database-using-DBCA Tool used in this tutorial is command prompt. This tutorial series is part of SQL expert exam certification training. if you are preparing for SQL certification you can use my tutorials. This SQL Tutorial is a part of free training. Copy Cloud referral link || Use this link to join copy cloud and get 20GB of free storage https://copy.com?r=j7eYO7 Contacts E-Mail [email protected] Twitter https://twitter.com/rebellionrider Instagram http://instagram.com/rebellionrider Facebook. https://www.facebook.com/imthebhardwaj Linkedin. http://in.linkedin.com/in/mannbhardwaj/ Thanks for linking, commenting, sharing and watching more of our videos This is Manish from RebellionRider.com
Views: 246615 Manish Sharma
MSSQL -  How to check if Stored Procedure existis and if exists display its definition
 
01:59
Copy code from here: http://howtodomssqlcsharpexcelaccess.blogspot.ca/2016/01/mssql-how-to-check-if-stored-procedure.html
Views: 291 Vis Dotnet
MSSQL - How to check if column in table exists
 
01:56
Query that checks if specified column exists in specified table. More info with ready to copy and paste example http://howtodomssqlcsharpexcelaccess.blogspot.ca/2013/03/ms-sql-check-if-column-exists-in-table.html
Views: 1361 Vis Dotnet
Oracle SQL Tutorial 13 - How to Add Column Constraints (Attributes)
 
05:55
So far, we have this table declaration: CREATE TABLE users( user_id NUMBER, username VARCHAR(50 CHAR) first_name VARCHAR2(50 CHAR), last_name VARCHAR2(50 CHAR) ) We can run this command see that it works. As we are learning though, we are going to want to be able to recreate our table with different settings and such, but if you try to run this command, it will complain that the table already exists. So we first need to delete this table before we start editing settings. When we get more experienced, we will learn about ways to edit the structure of a table that already exists. To fix this, we can get rid of the table using the DROP TABLE command: DROP TABLE users You can run this every time if you need to practice by adding a semicolon after it. This is how you can tell Oracle that you are putting in another command after it. This is known as a delimiter. When you run the script, it is going to run both commands. Now we can go through and reconsider our table structure. This is fine for starting out because we don't have any important data in our database, but once your database is in production you are not going to want to just drop tables. In the last video we discussed different constraints that you can apply to columns in a database table, but how do you actually apply these when you are creating a table? The first way you define constraints is to put them right after the column in your CREATE TABLE statement. CREATE TABLE users( username VARCHAR2(50 CHAR) NOT NULL ) When we define constraints this way, we usually say we are adding column attributes. If you have two constraints you want to add, you just put one after the other with spaces in between. There is no particular order that is required. CREATE TABLE users( username VARCHAR2(50 CHAR) NOT NULL UNIQUE ) In this situation we have already given the column the NOT NULL and UNIQUE attributes, so we should consider making this a primary key: CREATE TABLE users( username VARCHAR2(50 CHAR) PRIMARY KEY ) As you can see, adding column attributes is super easy. We can add a default like this: CREATE TABLE users( username VARCHAR2(50 CHAR) PRIMARY KEY, account_balance NUMBER DEFAULT 0 ) Note that now we need the comma after the first row. There are a few constraints we did not talk go through an example, specifically foreign keys and check constraints. We will be adding these constraints to our database in future videos. In the mean time, I have a thought for you… Many people prefer to name their column constraints. That way, we can refer to certain constraints by name. For example, we might have a primary key constraint that could be named users_pk. The way we are creating these constraints does not allow for this feature, so in the next video we are going to be discussing different ways to create constraints. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Support me on Patreon! http://www.patreon.com/calebcurry Subscribe to my newsletter: http://bit.ly/JoinCCNewsletter Donate!: http://bit.ly/DonateCTVM2. ~~~~~~~~~~~~~~~Additional Links~~~~~~~~~~~~~~~ More content: http://CalebCurry.com Facebook: http://www.facebook.com/CalebTheVideoMaker Google+: https://plus.google.com/+CalebTheVideoMaker2 Twitter: http://twitter.com/calebCurry Amazing Web Hosting - http://bit.ly/ccbluehost (The best web hosting for a cheap price!)
Views: 19076 Caleb Curry
Difference between Delete and Truncate and Drop in Oracle Sql
 
14:04
This is a free tutorial on understanding difference between drop, delete and truncate statements. I have tried to cover most of the major difference between all these three statements and have also shown the same with simple and easy to understand examples. Hope it will be helpful to all. If you want more such videos of exciting and amazing 'difference between' concepts, check out the links below : union and union all : https://youtu.be/n9FqQOd8liY char and varchar2 : https://youtu.be/039qzwjWf4k replace and translate : https://youtu.be/HKYF77BGzOE procedure and function : https://youtu.be/q3LmOenL120 in and exists : https://youtu.be/REX4IjRYlFw rank and dense_rank : https://youtu.be/WGSX998hZ9M %type and %rowtype : https://youtu.be/MlLUFeZ_3eM
Views: 1649 Kishan Mashru
Oracle SQL Tutorial 15 - How to Add Primary Key Constraints
 
02:54
The goal of this video is to take the CREATE TABLE statement we have and walk through the different ways to create primary keys. This and foreign keys are the most common constraints, so we need to make sure that you have this one down. Once we have a more complex database design with multiple tables, we will learn the proper way to create foreign keys. For now, I am going to keep all of our constraints at the column level, unnamed. The only exception is the primary key, because that is what we are focusing on in this video. The first way to create the primary key is at the column level, unnamed. The primary key is very important because it what we use to distinguish rows from one another. Every table you create is going to need a primary key, and I suggest putting a lot of effort into making sure your keys are set up correctly and organized. --Delete the table if needed: DROP TABLE users; CREATE TABLE users( user_id NUMBER PRIMARY KEY, username VARCHAR2(50 CHAR) NOT NULL UNIQUE ) The next way is at the column level, but named: --Delete the table: DROP TABLE users; CREATE TABLE users( user_id NUMBER CONSTRAINT users_pk PRIMARY KEY, username VARCHAR2(50 CHAR)NOT NULL UNIQUE ) The general naming convention here is the table name followed by an underscore, followed by pk for primary key. Finally, the third way, which is at the table level, is the way we are going to create our primary key: --Delete the table: DROP TABLE users; CREATE TABLE users( user_id NUMBER, username VARCHAR2(50 CHAR) NOT NULL UNIQUE, CONSTRAINT users_pk PRIMARY KEY (user_id) ) Now, once you've created these constraints, you can use Oracle SQL Developer to find these constraints. Open your databases in the connections tab and find the table in the Tables folder. Double click your table and travel to the Constraints tab. You can tell here that the UNIQUE constraint still exists in this table, but it has a pretty disgusting name. It kind of wants to make me puke. Referencing that constraint in the future with that wacky name would be a burden. Engrave these three options in your head so that you can use any of them whenever you need and can read other peoples' code. Thank you for sticking with the series thus far. In the next video, we will be…doing something. See you then! :) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Support me on Patreon! http://www.patreon.com/calebcurry Subscribe to my newsletter: http://bit.ly/JoinCCNewsletter Donate!: http://bit.ly/DonateCTVM2. ~~~~~~~~~~~~~~~Additional Links~~~~~~~~~~~~~~~ More content: http://CalebCurry.com Facebook: http://www.facebook.com/CalebTheVideoMaker Google+: https://plus.google.com/+CalebTheVideoMaker2 Twitter: http://twitter.com/calebCurry Amazing Web Hosting - http://bit.ly/ccbluehost (The best web hosting for a cheap price!)
Views: 13709 Caleb Curry
Dropping Tablesapce in oracle 12c (DIFFERENT METHODS)
 
04:25
The Oracle DROP TABLESPACE command is used to remove a tablespace from the database. In the following example, we will drop the USELESS tablespace from our database using the Oracle DROP TABLESPACE command: Drop tablespace useless; The Oracle DROP TABLESPACE command Oracle will generate an error if objects reside in the tablespace. Do the following to remove all objects in the tablespace prior to using Oracle DROP TABLESPACE command: Drop tablespace useless including contents; Oracle does not clean up after itself wile using the Oracle DROP TABLESPACE command by default. An option exists to force Oracle to clean up after itself using the Oracle DROP TABLESPACE command. The following example illustrates the Oracle DROP TABLESPACE command used with the including contents and datafiles keywords: Drop tablespace useless including contents and datafiles;
Views: 131 Mohammad Taseen
SQL tutorial 60: SQL View in Oracle Database By Manish Sharma RebellionRider
 
07:30
SQL View in Oracle Database. In this tutorial you will learn how to create a vie as well as how to replace a view along with the examples of all the DML e.g. DESCRIBE, SELECT, UPDATE, INSERT and Delete on view by Manish Sharma RebellionRider ------------------------------------------------------------------------ ►►►LINKS◄◄◄ Blog : http://bit.ly/sql-view-in-oracle-database Previous Tutorial ► Tut 5: SELECT statement http://youtu.be/f_mVBVgnqmM ------------------------------------------------------------------------- ►►►Help Me In Getting A Job◄◄◄ ►Help Me In Getting A Good Job By Connecting With Me on My LinkedIn and Endorsing My Skills. All My Contact Info is Down Below. You Can Also Refer Me To Your Company Thanks ------------------------------------------------------------------------- Copy Cloud referral link || Use this link to join copy cloud and get 20GB of free storage https://copy.com?r=kb4rc1 -------------------------------------------------------------------------- ►Make sure you SUBSCRIBE and be the 1st one to see my videos! -------------------------------------------------------------------------- Amazon Wishlist: http://bit.ly/wishlist-amazon ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ►►►Find me on Social Media◄◄◄ Follow What I am up to as it happens on https://twitter.com/rebellionrider https://www.facebook.com/imthebhardwaj http://instagram.com/rebellionrider https://plus.google.com/+Rebellionrider http://in.linkedin.com/in/mannbhardwaj/ http://rebellionrider.tumblr.com/ http://www.pinterest.com/rebellionrider/ You can also Email me at [email protected] Please please LIKE and SHARE my videos it makes me happy. Thanks for liking, commenting, sharing and watching more of our videos This is Manish from RebellionRider.com ♥ I LOVE ALL MY VIEWERS AND SUBSCRIBERS
Views: 40826 Manish Sharma
Java & MySQL - Check if a value already exists
 
12:03
Easy tutorial on how to check if a value already exists in the database.
Views: 26367 Mozoran
#dropstoredprocedure #dropprocedure #sqlprocedure How To Drop Stored Procedure In SQL
 
02:43
sql drop stored procedure if exists, drop procedure sql server if exists, drop procedure mysql, , drop stored procedure oracle , how to delete all stored procedure in sql server , drop procedure db2 , drop stored procedure w3schools , sql create procedure Dosto AAP sabhi ka swagat h mere Youtube Channel Technical Sanatan me, Mai daily Software and Hardware Related Videos Post Karta hu....Plzz Support.. Like , Comment Subscribe: https://www.youtube.com/user/sanatan330 Twitter: https://twitter.com/SANATANSHARMA Facebook: https://www.facebook.com/sanatan09 Facebook Page: https://www.facebook.com/sqltu/ Instagram: https://www.instagram.com/panday_sanatan_sharma/ Website: https://pandaysanatansharma.blogspot.in/ Agar aapko kuchh samajh me nahi aa rh h to, comment ke through puchh skte h. Thnk u About :Technical Sanatan is a YouTube Channel, Here I post Software and Hardware related Videos.)
Views: 29 Technical Sanatan
8. Use LOG ERRORS to suppress SQL errors at the row level.
 
06:23
The impact of a non-query DML statement is usually "all or nothing". If my update statement identifies 100 rows to change, then either all 100 rows are changed or none are. And none might be the outcome if, say, an error occurs on just one of the rows (value too large to fit in column, NULL value for non-NULL column, etc.). But if you have a situation in which you would really like to "preserve" as many of those row-level changes as possible, you can add the LOG ERRORS clause to your DML statement. Then, if any row changes raise an error, that information is written to your error log table, and processing continues. IMPORTANT: if you use LOG ERRORS, you must must must check that error log table immediately after the DML statement completes. You should also enhance the default error log table. Related blog post: http://stevenfeuersteinonplsql.blogspot.com/2016/03/nine-good-to-knows-about-plsql-error.html ======================================== Practically Perfect PL/SQL with Steven Feuerstein Copyright © 2015 Oracle and/or its affiliates. Oracle is a registered trademark of Oracle and/or its affiliates. All rights reserved. Other names may be registered trademarks of their respective owners. Oracle disclaims any warranties or representations as to the accuracy or completeness of this recording, demonstration, and/or written materials (the “Materials”). The Materials are provided “as is” without any warranty of any kind, either express or implied, including without limitation warranties or merchantability, fitness for a particular purpose, and non-infringement.
Delete, Drop, and Truncate Statements in Hive
 
06:41
Delete, Drop, and Truncate Statements in Hive Delete Statement: Delete statement is used to delete certain rows from a table based on a condition specified using the WHERE clause. The syntax is in below as highlighted. DELETE FROM tablename [WHERE expression]; Note: DELETE statement is available from hive 0.14.0 version and above Drop Statement: The drop table statement is used to drop the table altogether. The syntax is highlighted here: DROP TABLE IF EXISTS TABLENAME; Let’s quickly see how the managed table and external table differs when dropping the table. We have already discussed this in the “Two different types of hive tables” video. Take a look at it if you haven’t. For the managed hive tables, the drop table statement removes the metadata information as well as the data. The data will be actually moved to .Trash/Current directory. metadata will be permanently deleted. However for external tables, only the metadata information is permanently deleted and the actual data remains intact in the hdfs directories. So in the case of external table, if the table was deleted accidentally, then the table can be re-created by using the same schema and specifying the same location for the hdfs data directory. If deleting the external table was the intention, then after deleting the table using the drop statement, you may also delete the underlying hdfs data directory by issuing the hdfs dfs -rm command. Truncate Statement: Truncate table statement is used to remove only the data from the table. The table structure with the schema remains intact. Truncate removes all the rows from a table or partition. The syntax is highlighted below. TRUNCATE table syntax TRUNCATE TABLE TABLENAME;
Views: 1235 BigDataElearning
Difference Between Delete and Truncate
 
03:41
Below is link for Useful Pl/SQL Books http://goo.gl/XMy0tt ---------------------------------------------------------- Difference Between Delete and Truncate in Detail On bigger picture they serve the same purpose but there are many Differences listed with examples Point Delete Truncate 1. Data Recovery Delete: Come under the DML Category, we need to commit or Rollback explicitly to make the changes permanent, so we can recover the data by Rollback command fully with in a session or up to a point if Save Points are used Fall In DDL Category (DDL Command issue the Auto commit implicitly) so no chances of Recovery even not using the Flashback table method. But Truncate operations are also logged , they didn’t generate redo SQL but they are logged , view for truncated data info V$LOGMNR_CONTENTS 2. Data Removal Delete Can remove all or selected data using the Where Clause predicates. Or we can say delete any subset of rows We can Truncate complete table or a partition or sub partition of a table. 3. Speed Delete is Slower because oracle maintain the redo logs for Read Consistency (so that every session connected can see a consistent data at a given point of time ) Delete is very time consuming activity especially when table have numerous indexes and Triggers associated with table Faster as no data logs are maintained no associated trigger firing. 4. DML Triggers Firing DML (Delete) triggers associated with table will fire. DML Trigger will not fire in case of truncate method. 5. Flashback Technology Data can be recovered even after commit operation using Flashback Table options Flashback_transaction_query table will give what to recover and up to which point. Data cannot be recovered in truncate method by Flashback table option. 6. Referential Integrity Constraint Behavior if we don’t have related data in child table then we can delete the data from the parent table or we have variants like On Delete Cascade & on Delete set Null. We can’t truncate a table with enable Referential Integrity Constraint, even there is no data in the child table, we have to disable or drop the constraint if we want to truncate the table. Exception: Truncate is possible if the FK is self-referential means primary key and foreign key are on the same table. 7. Space De allocation or Space Utilization No extent reset with delete when deleting rows from a table, extents are not de allocated, So if there were 50 extents in the table before the deletion, there will still be 50 after the deletion. Truncate: When a table is truncated it will free the space allocated except in case of reuse storage clause. This space can subsequently be used only by new data in the table or cluster resulting from insert or update operations .All extents are de allocated leaving only the extents specified when the table was originally created .Example So if the table was originally created with min extents 3, there will be 3 extents remaining when the tables is truncated. When you truncate a table, NEXT is automatically reset to the last extent deleted. 8. High Water Mark Delete will not reset the high water mark Truncate will reset the High Water mark which is very important for performance point of view as in case of full table scan and full index scan oracle will read all the block under high water mark this makes a lot of difference in terms of performance. 9. Cluster No as such restriction with delete. You cannot individually truncate a table that is part of a cluster. You must truncate the cluster, Delete all rows from the table, or drop and re-create the table. 10. Information Capturing Delete : we can capture the row information what we have deleted using Delete Method, f you are deleting multiple records then use composite data types (collections & records) Truncate Don’t have this feature of capturing the deleted records. 11. Function Based Index Impact DELETE You cannot delete rows from a table if a function-based index on the table has become invalid. You must first validate the function-based index. Truncate: No as such restriction 12. UNUSABLE Indexes Delete no as such feature. Truncate if table is not empty then truncate make all unusable indexes to useable. 13. Complex views You cannot delete data from a Complex view except through INSTEAD OF triggers. But we can delete data from simple Views and MV. We cannot truncate a view simple or complex but you can truncate MV with special Features like Preserve MV Logs and Purge MV Logs. 14. Privileges Delete You need to provide delete table privilege on object. Truncate you must have drop table privilege there is no truncate table privilege exists. 15. Domain Index No as such restriction You cannot truncate the object having domain index in invalid or In progress state
Views: 12846 Ram Gupta
Oracle Database11g tutorials 14 : How to CREATE TABLE using sql developer and command prompt
 
08:36
Oracle Database11g tutorials 14 How to Create table using command prompt and Create table using sql developer Blog Link http://bit.ly/1TkY4Oe Time Line 0:25 Introduction of Tables in Database 1:03 What is Create Table (Introduction of create table) 1:30 Syntax of Create Table 2:08 How to create table using Command Prompt 4:55 How to create table using SQL Developer Links for Oracle Database tutorials 4: database connectivity using SQL developer and command prompt http://youtu.be/wSqoXRlXDUU You can have indepth knowledge about SQL create table here http://www.rebellionrider.com/sql-create-table.html Tool used in this tutorial is command prompt. This tutorial series is part of SQL expert exam certification training. if you are preparing for SQL certification you can use my tutorials. This SQL Tutorial is a part of free training. Copy Cloud referral link || Use this link to join copy cloud and get 20GB of free storage https://copy.com?r=j7eYO7 Contacts E-Mail [email protected] Twitter https://twitter.com/rebellionrider Instagram http://instagram.com/rebellionrider Facebook. https://www.facebook.com/imthebhardwaj Linkedin. http://in.linkedin.com/in/mannbhardwaj/ Thanks for linking, commenting, sharing and watching more of our videos This is Manish from RebellionRider.com Today in this oracle database tutorial we will see How to CREATE A TABLE. if we have to define a table in layman language then we can say that Tables are just a collection of Rows and Columns but In RDBMS tables are database objects which help in organizing data into ROWS and COLUMNS. We can also say that SQL tables are kind of data structure which are used by database for efficient storage of data. To create a table in our database we use SQL CREATE TABLE command. SQL CREATE TABLE is a type of DATA DEFINITION LANGUAGE also known as DDL. To Create a table in your schema you will require CREATE TABLE system privilege. In our future videos we will see what are system and object privileges and how to grant them to a user. Today for this video we will be using Sample schema HR which already has all the necessary privileges. Ohk Let's see the syntax. CREATE TABLE table name ( column name1 Data-Type(size), column name2 Data-Type(size), ..... ); CREATE TABLE is an oracle reserved word or say an Oracle key word whereas There are 3 different ways of creating a table in Oracle database. Creating a table using Command Line Interface (CLI) in Oracle database For demonstrating how to create table in oracle database using CLI, I'll be using Command prompt. Thats how we create table using command prompt. you can check your table structure by DESCRIBE command for that just write DESC and your table name. Like this Another way of creating a table is by using Graphic user interface (GUI) in Oracle database To demonstrate how to create table using GUI we will use SQL developer. Lets open our SQL developer I am connected to HR schema if you do not know how to create a connection to database using SQL developer please watch my oracle database tutorial 4 that explains database connectivity using SQL developer and command prompt. Link for this video is in the description below. So lets create a table. Creating a table using SQL developer is very easy we do not have to fire any query here. Let's start First of all right click on your connection in which you want to create a table and choose schema browser. This will open a separate schema browser pane or you can expend your connection by clicking this + sign and then right click on table and choose New Table. However I prefer working with schema browser so let's skip to schema browser pane here from the first drop-down list you can choose connection name and in the second drop down list you can choose what database objects you want to work with we want to create a table thus I'll choose table and then click this arrow here and choose option for new table Ok we have created a table wizard first of all give a unique name to your table and add some column as well. For this, click the green plus button. Now we already have a column so give it some name. Also choose a datatype from the list and specify any size you can check this not null column if in case you want to make this a mandatory column you can also specify default value and constraint If you want to make this column a primary key you can click here In my future video i'll show you what are these constraints and different ways of applying them on a column in a table. for this video we will concentrate on create table only so when you are done with all your columns click ok Thats your table You can double click on your table here and can see its structure. Thats it
Views: 172674 Manish Sharma
DIFFERENCES BETWEEN IN AND EXISTS OPERATOR
 
18:11
IN AND EXISTS OPERATORS
Views: 2162 SAINAATTH PITTLA
17/125 Oracle PLSQL: Handling Nulls in IF Statement
 
09:23
Learn Oracle PLSQL EXAM 1Z0-144
Views: 1021 khaled alkhudari
Oracle SQL Tutorial 16 - Parent Child Relationships
 
06:09
So far in this series we have discussed database design, creating tables, and constraints. We've brought up the concept of foreign keys, but we have not explained how to create them. That is the goal of this video and the upcoming videos. We want to study those foreign keys! Let's make them not so foreign. Let's learn the proper way to define a foreign key. As a reminder, a foreign key is a column that references a column of another table. The column it references must either be a primary key, or have the UNIQUE constraint. This means that every value inside of the column that is labeled as a foreign key, there must be that value in some row of the referenced column. As an example, imagine that we have the users table, and we have a table service_requests. We could have a column in the service_request that references a column in the users table. Usually this would be the primary key that is referenced, but there is nothing stopping you from referencing a unique column. Just for fun, let's go through an example using the username column. If we have a service_requests table, every single row within the table is going to be what some would consider an instance of a service_request. This means that the table columns are like the blueprint for what a service request looks like and then each row is an individual service request. If we have one of the columns labeled as a foreign key to the username of the users table, what does that mean practically? It means that for a single row, the value for that column must be a value that exists in the users table. We could have a service_request submitted by a user with the username of Yoloswagman. This means that there must be a row inside of the users table that has the value Yoloswagman for the username column. This brings up the concept of parent and child relationships. Yoloswagman in this situation is the parent, and his service request is the child. When we draw it out, it makes sense why a primary key must be UNIQUE. If we had two Yoloswagmans, the child would not know which column is the parent. The same applies if we were using IDs and we had So remember, always reference a primary key or a column with the UNIQUE constraint. Now, I have a question for you. Do foreign keys automatically have the UNIQUE constraint, just like primary keys? The answer is no. A parent row can have many child rows. It makes sense because the user could submit multiple service requests. Can we force the column to be unique? Absolutely. If that was the case, the user could only make one service request. Another question. Do foreign keys automatically have the NOT NULL constraint, just like primary keys? The answer is no. Essentially what this means is that a child could be created with no parent. Can we force the column to be NOT NULL? Absolutely. It is ok in some situations to allow the row to be null, but in this situation it makes no sense. It would be wise for us to add that constraint ourselves. So now that you understand some more differences between primary and foreign keys and parent child relationships, take all of these questions into consideration when you are creating foreign keys. In the next video, we are going to start a small project that is going to require multiple tables. We'll take a video to design our structure and then we'll get to creating those foreign keys in Oracle SQL Developer. Stick around and if you like these videos please be a serious supporter and subscribe to my channel. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HELP ME! http://www.patreon.com/calebcurry Subscribe to my newsletter: http://bit.ly/JoinCCNewsletter Donate!: http://bit.ly/DonateCTVM2. ~~~~~~~~~~~~~~~Additional Links~~~~~~~~~~~~~~~ More content: http://CalebCurry.com Facebook: http://www.facebook.com/CalebTheVideoMaker Google+: https://plus.google.com/+CalebTheVideoMaker2 Twitter: http://twitter.com/calebCurry Amazing Web Hosting - http://bit.ly/ccbluehost (The best web hosting for a cheap price!)
Views: 11516 Caleb Curry
SQL tutorials 18: SQL Foreign Key Constraint
 
10:23
SQL Tutorial 18: SQL foreign key constraint. Topic covered in this tutorial 1. Defining SQL foreign key using create table at column level 2. Defining SQL foreign key using create table at table level 1. Defining SQL foreign key using Alter Table statement Links Website article: http://www.rebellionrider.com/sql-foreign-key.htm Primary key tutorial: http://www.rebellionrider.com/sql-foreign-key.htm Create Table Tutorial: http://www.rebellionrider.com/sql-create-table.html Tool used in this tutorial is SQL Developer. This tutorial series is part of SQL expert exam certification training. if you are preparing for SQL certification you can use my tutorials. This SQL Tutorial is a part of free training. Copy Cloud referral link || Use this link to join copy cloud and get 20GB of free storage https://copy.com?r=j7eYO7 Contacts E-Mail [email protected] Twitter https://twitter.com/rebellionrider Instagram http://instagram.com/rebellionrider Facebook. https://www.facebook.com/imthebhardwaj Linkedin. http://in.linkedin.com/in/mannbhardwaj/ Thanks for linking, commenting, sharing and watching more of our videos This is Manish from RebellionRider.com Foreign key is an Input/output data constraint which is also known as referential integrity constraint. Foreign key represent a link or say a relationship between columns of tables. Similar to primary key constraint Foreign Key constraint is also of two types. Simple Foreign key constraint and Composite Foreign key constraint. Constraint which involves only one column in foreign key in child table and one column in reference key in parent table is called Simple Foreign Key. While the constraint which involves more than one column in foreign key in child table and more than one column in reference key in the parent table is called Composite Foreign Key.
Views: 100305 Manish Sharma
Difference Between Case and Decode
 
06:03
What is the difference between case and decode ? Important links for Oracle Developers For for SQL - PL/SQL Interview Questions Answers Facebook group https://www.facebook.com/groups/146487615764170/ Download Free PLSQL Interview Books , Documents Videos from here https://www.facebook.com/groups/146487615764170/files/ Free SQL / PLSQL Video on YouTube Channel SUBSCRIBE https://www.youtube.com/c/ramguptaoracle?sub_confirmation=1 Visit oracle forms / report / SQL PLSQL blog http://oracletemple.blogspot.in/ Oracle Community Google+ https://plus.google.com/u/0/collection/4mW-jB Join our facebook group https://www.facebook.com/groups/146487615764170/ Follow us on Twitter https://twitter.com/Rameshwar275 Simply Like and Share :) Oracle SQL PLSQL FaceBook group https://www.facebook.com/groups/146487615764170/ ORACLE SQL PLSQL VIDEO LINKS What is Parameterized Cursor in Oracle https://www.youtube.com/watch?v=JMKwHlVi6-A What is autonomous transaction in Oracle. https://www.youtube.com/watch?v=gyvFajpfoWE What are Constraints available in Oracle. https://www.youtube.com/watch?v=WivhdLXQklQ What is Mutation Error and How to avoid mutation. https://www.youtube.com/watch?v=CbWNCyW18Bs 5 Effective way to delete Duplicate rows https://www.youtube.com/watch?v=1wtTtnc87Oc What is Difference between Delete and Truncate https://www.youtube.com/watch?v=7b6wQ3Qumgg What are types of View available in Oracle https://www.youtube.com/edit?o=U&video_id=PN-NsSA2R-E
Views: 3696 Ram Gupta
Oracle SQL Tutorial 22 - Why Primary Keys Shouldn't Change
 
07:14
In the last video I mentioned that with our database design it is important to make sure that nobody tries to update a user's username. What happens if they do? Nothing horrible, Oracle will just throw an error. That's not such a big deal, but if you are hoping to make some kind of application that allows someone to change their username, this is not the best set up. Why? If you look at the projects table, we have a foreign key that references the username. Let's assume for a moment that Oracle allows you to do anything with your data. That means that if a user updates their username, there will be projects created by users that don't exist. Or a user could change their name to the previous owner. To fix this problem, we would need something such as an ON UPDATE CASCADE command for our foreign key. That would mean that if the user updated their username, the columns that reference that username would also update to the new value. This exists in some database management systems, but this does not exist in Oracle at the time of this video. How do we get around this problem? I'm sure we could conjure up something to allow us to update the username, but the easiest solution is to reference the user_id instead of the username. That way, when the username is updated, nothing changes inside of the foreign key. As a general rule, primary keys should never change. Foreign keys CAN change, but they should not change because a primary key changed. So, if we did happen to use a username as a column, it would be frowned upon if the username had to change because the column it references changes. However, it would be acceptable to change the foreign key if we needed to point to a new entity in the users table. Even if a username is never intended to change, these complications bother a lot of people. You can mitigate these problems by only referencing surrogate keys in foreign keys. This has the downside though that when you retrieve the data, you are going to have to do more work to make the data readable. For example, we had a table that was called project_users. It is essentially a table that says what users are part of what projects. We could have the foreign keys reference the project's name and the user's username. Then when you could say SELECT * FROM project_users. The data would be completely readable without doing anything. If you switch to only referencing surrogate primary keys, you will have a bunch of random numbers that don't mean anything and will have to be joined with other tables…which is really super frustrating when later you have to join a thousand tables to read anything. Which side do you prefer? Pick a side. Choose wisely. I'll see you all in the next video ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HELP ME! http://www.patreon.com/calebcurry Subscribe to my newsletter: http://bit.ly/JoinCCNewsletter Donate!: http://bit.ly/DonateCTVM2. ~~~~~~~~~~~~~~~Additional Links~~~~~~~~~~~~~~~ More content: http://CalebCurry.com Facebook: http://www.facebook.com/CalebTheVideoMaker Google+: https://plus.google.com/+CalebTheVideoMaker2 Twitter: http://twitter.com/calebCurry Amazing Web Hosting - http://bit.ly/ccbluehost (The best web hosting for a cheap price!)
Views: 5395 Caleb Curry
Part 4   Delete duplicate rows in sql
 
03:26
Link for all dot net and sql server video tutorial playlists http://www.youtube.com/user/kudvenkat/playlists Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2014/05/part-4-delete-duplicate-rows-in-sql.html In this video, we will discuss deleting all duplicate rows except one from a sql server table. SQL Script to create Employees table Create table Employees ( ID int, FirstName nvarchar(50), LastName nvarchar(50), Gender nvarchar(50), Salary int ) GO Insert into Employees values (1, 'Mark', 'Hastings', 'Male', 60000) Insert into Employees values (1, 'Mark', 'Hastings', 'Male', 60000) Insert into Employees values (1, 'Mark', 'Hastings', 'Male', 60000) Insert into Employees values (2, 'Mary', 'Lambeth', 'Female', 30000) Insert into Employees values (2, 'Mary', 'Lambeth', 'Female', 30000) Insert into Employees values (3, 'Ben', 'Hoskins', 'Male', 70000) Insert into Employees values (3, 'Ben', 'Hoskins', 'Male', 70000) Insert into Employees values (3, 'Ben', 'Hoskins', 'Male', 70000) The delete query should delete all duplicate rows except one. Here is the SQL query that does the job. PARTITION BY divides the query result set into partitions. WITH EmployeesCTE AS ( SELECT *, ROW_NUMBER()OVER(PARTITION BY ID ORDER BY ID) AS RowNumber FROM Employees ) DELETE FROM EmployeesCTE WHERE RowNumber ] 1
Views: 321787 kudvenkat
MySQL Tutorial #20 in Hindi: VIEWS in MySQL - Create View, With Check Option, Manage Views
 
23:37
MySQL Tutorial #20 in Hindi: VIEWS in MySQL - Create View, With Check Option, Manage Views How to Alter View How to Drop a View How to See View Defintion MySQL tutorial for Beginners MySQL Installation Guide How to Install MySQL on windows 10
Difference between Replace and Translate function in oracle
 
03:46
This video demonstrates the difference between a replace function and a translate function in oracle using an suitable example. Both the function does a similar task, but has a lot of difference in implementation and output when used. Be learning the difference users can easy justify the correct scenarios on where to use translate and when to use replace. If you want more such videos of exciting and amazing 'difference between' concepts, check out the links below : union and union all : https://youtu.be/n9FqQOd8liY char and varchar2 : https://youtu.be/039qzwjWf4k procedure and function : https://youtu.be/q3LmOenL120 in and exists : https://youtu.be/REX4IjRYlFw rank and dense_rank : https://youtu.be/WGSX998hZ9M delete and truncate : https://youtu.be/u76wMm2byXo %type and %rowtype : https://youtu.be/MlLUFeZ_3eM
Views: 1936 Kishan Mashru
Updating a Table with SSIS
 
06:19
Updating a Table with SSIS
Views: 102181 Rick Caminiti
How to Resolve Oracle SQL Parent Key Not Found (ORA-02291)
 
05:49
In this video, we’ll explain what the ORA-02291 “parent key not found” error is, see an example, and look at how to resolve it. This error usually happens when we try to insert data into a table. It looks like this: Error is: ORA-02291: integrity constraint (constraint_name) violated - parent key not found So what does this error mean? It means we’re trying to insert data into a child table, and there is no related record in the parent table. If a foreign key has been set up to enforce this relationship, there needs to be a parent to insert a child that refers to it. Watch the video to see an example of this error as well as how to resolve it. For more information on Oracle SQL, refer to the Database Star website here: https://www.databasestar.com/
Views: 1797 Database Star
MySQL alter table drop index
 
00:57
MySQL alter table drop index, borra el indice asociado a una tabla
Views: 997 Francisco Arce
SQL Tutorial - 13: Inserting Data Into a Table From Another Table
 
07:00
In this tutorial we'll learn to use the INSERT Query to copy data from one table into another.
Views: 241782 The Bad Tutorials
Working with Orchestrated Integrations in Oracle Integration Cloud Service
 
04:38
When should you use an Orchestration integration? How do you create an Orchestration integration? This video shows you how. Learn more about Orchestration: https://docs.oracle.com/cloud/latest/intcs_gs/ICSUG/GUID-F66ABE41-0A69-4A73-BC3D-0CE36FA78C4D.htm#ICSUG-GUID-36A90FF0-F0D4-4F81-9028-41971C7D100B ================================= For more information, see http://www.oracle.com/goto/oll Copyright © 2016 Oracle and/or its affiliates. Oracle is a registered trademark of Oracle and/or its affiliates. All rights reserved. Other names may be registered trademarks of their respective owners. Oracle disclaims any warranties or representations as to the accuracy or completeness of this recording, demonstration, and/or written materials (the “Materials”). The Materials are provided “as is” without any warranty of any kind, either express or implied, including without limitation warranties or merchantability, fitness for a particular purpose, and non-infringement.
VIEWS IN ORACLE SQL WITH EXAMPLES
 
15:13
This video explains about views in Oracle SQL, views are integral part of any database, and its important to clearly understand views to work with them. Views are named and stored sql statements which would be executed once we call the view, views in whole do not store the data except if its a Materialized view. Views are widely used in day to day programming and can be useful in various cases, we discussed about all those cases in this video. If you would like to learn more on materialized view, visit the below videos https://youtu.be/7PklhTCNxxw https://youtu.be/EDf8Pk-x_nA If you want to know the difference between views and Materialized view, visit https://youtu.be/BnNKws_7_jc Visit our blog at www.oracleplsqlblog.com All out youtube videos: www.youtube.com/c/kishanmashru
Views: 1322 Kishan Mashru
PL/SQL tutorial 84: ALTER & DROP table DDL with Execute Immediate of Dynamic SQL
 
07:46
Learn how to modify and delete a table using ALTER and DROP TABLE DDL with EXECUTE IMMEDIATE of native dynamic SQL in Oracle Database by Manish Sharma from RebellionRider.com 02:12 ALTER TABLE with Execute Immediate 04:48 DROP TABLE with Execute Immediate ------------------------------------------------------------------------ ►►►LINKS◄◄◄ Blog: http://bit.ly/nds-5 Previous Tutorial ► PL/SQL Tutorial 83 https://youtu.be/dl39itjrWYw ► Facebook Note Ora--12505 TNS error http://bit.ly/Ora-12505 ------------------------------------------------------------------------- ►Make sure you SUBSCRIBE and be the 1st one to see my videos! ------------------------------------------------------------------------- ►►►Find me on Social Media◄◄◄ Follow What I am up to as it happens on https://twitter.com/rebellionrider http://instagram.com/rebellionrider https://plus.google.com/+Rebellionrider http://in.linkedin.com/in/mannbhardwaj/ ___Facebook Official Page of Manish Sharma___ https://www.facebook.com/TheRebellionRider/ ___Facebook Official Page of RebellionRider.com___ https://www.facebook.com/RebellionRider.official/ You can also Email me at for E-mail address please check the About section Please please LIKE and SHARE my videos it makes me happy. Thanks for liking, commenting, sharing and watching more of our videos This is Manish from RebellionRider.com ♥ I LOVE ALL MY VIEWERS AND SUBSCRIBERS
Views: 2257 Manish Sharma
Oracle Database11g tutorials 8 || SQL DISTINCT with multiple columns |SQL Distinct with Two columns
 
04:33
This SQL tutorial and Oracle database 11g tutorial for beginners will show how to use SQL DISTINCT keyword with SQL Select clause. This Video is in the continuation of previous video on SQL distinct with one column. In this video we will see How to use SQL distinct with multiple columns and SQL distinct with two columns Tool used in this tutorial is SQL developer. This tutorial series is part of SQL expert exam certification training. If you are preparing for SQL certification you can use my tutorials. This SQL Tutorial is a part of free training. Copy Cloud referral link || Use this link to join copy cloud and get 20GB of free storage https://copy.com?r=j7eYO7 Contacts Email [email protected] Twitter https://twitter.com/rebellionrider Instagram http://instagram.com/rebellionrider Facebook. https://www.facebook.com/imthebhardwaj Linkedin. in.linkedin.com/in/mannbhardwaj/ Thanks for linking, commenting, sharing and watching more of our videos This is Manish From The Code makers
Views: 97552 Manish Sharma
How to drop VIEW in MySQL ?
 
02:39
ySQL Drop VIEW You can drop the VIEW by using the DROP VIEW statement. Syntax: DROP VIEW [IF EXISTS] view_name; Subscribe channel on YouTube:- https://www.youtube.com/channel/UCrp7exVNwPV4lxnc_-X9YTQ/videos Read this post on Blogger:- http://ipctrd.blogspot.in/ Like page on Facebook:- https://www.facebook.com/ipctrd/ Tweet about video on twitter:- https://twitter.com/ipctrd Let's chat on whatsapp:- https://chat.whatsapp.com/BrHbRDvbfs64CulIoLfbjf See you at Instagram :- https://www.instagram.com/ipctrd/ Google+ :- https://plus.google.com/u/0/101013097390807587448
Views: 441 Ipctrd
Procedure Cursor Exists N IN keywords
 
27:47
Sql Server 2008 R2 Procedure Create & Using Cursor
Views: 23 Shivashwor Joshi
Row Number Vs Rank Vs Dense Rank
 
07:04
This video shows the difference between row_number, rank and dense_rank analytical functions in oracle database with appropriate easy to understand examples, along with it the video demonstrates the different output obtained when using either of the three functions. Apart from simple explanation of the function we also show how partition by and order by clause can be used with the functions for tacking day to day scenarios. If you want more such videos of exciting and amazing 'difference between' concepts, check out the links below : union and union all : https://youtu.be/n9FqQOd8liY char and varchar2 : https://youtu.be/039qzwjWf4k replace and translate : https://youtu.be/HKYF77BGzOE procedure and function : https://youtu.be/q3LmOenL120 in and exists : https://youtu.be/REX4IjRYlFw delete and truncate : https://youtu.be/u76wMm2byXo %type and %rowtype : https://youtu.be/MlLUFeZ_3eM
Views: 2413 Kishan Mashru
CREATE/DROP TABLE MySQL Workbench
 
04:30
Enkelt eksempel på hvordan man oppretter og fjerner en tabell. Eksempelet viser kjøring av SQL direkte, og også via MySQL Workbench GUI.
Views: 297 Per Lauvås
DIFFERENCE BETWEEN CHAR AND VARCHAR2 DATATYPE IN ORACLE SQL
 
04:36
This video tutorial explains the difference between similar looking and used char datatype and varchar2 datatypes with an simple example. This video will answer the question such as how is the data internally stored differently for char and vacchar2 datatype. Also why is varchar2 much better option to be used than char data type is explained. If you want more such videos of exciting and amazing 'difference between' concepts, check out the links below : union and union all : https://youtu.be/n9FqQOd8liY replace and translate : https://youtu.be/HKYF77BGzOE procedure and function : https://youtu.be/q3LmOenL120 in and exists : https://youtu.be/REX4IjRYlFw rank and dense_rank : https://youtu.be/WGSX998hZ9M delete and truncate : https://youtu.be/u76wMm2byXo %type and %rowtype : https://youtu.be/MlLUFeZ_3eM
Views: 2918 Kishan Mashru
MSSQL - Sql server - insert into table if record doesn't exist
 
01:40
More info http://howtodomssqlcsharpexcelaccess.blogspot.com/2018/06/mssql-sql-server-insert-into-table-if.html
Views: 60 Vis Dotnet
Oracle 12c PL/SQL Security New Features - Session 5 of 8 - The New Inherit Privileges Privilege
 
06:47
Learn the Oracle Database 12c Inherit Privileges Privilege. Demonstration and Examples. There's a whole new privilege. The inherit privileges privilege. We indeed inherit any privileges privileged. That's just in privileged of course. Any privileges - system privileges, any privileges is an object privilege or new type objects. We can now assign privileges, grant privileges on users. It limits the owner's inheritance of privileges from the invoker. Oracle Corporation is presumably reasonably happy with the way definer's rights code works and definer's rights code as I demonstrated can be highly dangerous. That hasn't really changed in the current release except is will see with the ability to grant roles to code because in invoker's rights we've got huge differences and that's the inheriting of privileges privilege. If you don't have the inheritance enabled, any attempt to execute invoker's rights code will fail because the definer will not be in able to inherit the rights of the invoker. So I'm going to go straight in to do it and then go through the rest of the slides so we can see the sort of issue. Let me lose 11g and go to 12c. What I shall do is create my low privileged user or drop user dev. I don't think he exists. He doesn't. So I'll create my low privileged user. Grant create session, create procedure, select any table to dev identified by dev. It's the same mechanism I use. The same command I use in 11g. I'm creating a developer with a bare minimum that he needs to do his job, which is writing code that lets people query the database. Then log on as him, comm dev/dev and create my procedure. I'll create a version of the code, create or replace procedure list_emp, author ID current user. Invoker's rights code. Remember, this gives my low privilege user dev the ability to insert something horrible in his code which shall then be executed with the invoker's rights. We create the procedure. Now connect / as sysdba - I'll be the highest possible person there is - set server output on and run the code. Execute dev.list_emp looking for the CLARKS. I can't do it. Even as user sys, I can't run that because of the lack of this new privilege. I can correct the situation. I can grant inherit privileges on user sys - which of course one would never normally do - to dev. So I'm now giving my low privilege user the ability to inherit the privileges of user sys when we are running invoker's rights code. And having done that, the code now succeeds. That's the general principle. Without this inherit any privileges code all that doesn't have any privileges privilege, all your invoker's rights code is now blocked. It simply won't run until you grant that privilege to your trusted user. So without inheritance the invoker's rights code will fail. This privilege is in fact granted by default in 12.1 when a user is created. I believe this is purely for backward compatibility. So you don't have to worry about all your codes ceasing to function the moment you have to upgrade but there's no guarantee that this situation will remain as we go through 12.2, 12.3. Also in upgrade I haven't had the time to test comprehensively every possible method of upgrade but certainly this simple test I've done so far, the privilege does appear to be being granted and we can see it. If we look at who's been granted this privilege so far Select grantee, table_name, privilege from dba_tab_privs where privilege like inherit and we see that straight out of the box inherit privileges on a number of users have been granted to public. They have been granted to public. So if I create a brand new user, I grant connect to jw identified by jw, we will see that in the current release - there he is - inherit has beeen granted to public. In the current release by default, your code will continue to function and Oracle often does this with their [05:46 inaudible] with powerful new features. By default, it's configured so there's no change and in the next release it all changes. That's happened to a quite a few releases, quite a few new features, and it wouldn't surprise me if by the time we get to say 12.2 and certainly by the time we get to 13 this behavior changes. So plan for it and look at that privilege and see who it's been granted to and secure your systems. What you need to do is revoke all the inherit privileges grants that's there by default and then grant inherit any privileges very, very sparingly only to a very few trusted users and that should tighten up the danger of definer's inheriting invoker's rights. So a few trusted schemas, create the code in those schemas only and control this very tightly indeed.
Views: 1564 SkillBuilders
How to Create and Drop Table in SQL
 
01:53
Follow this easy step by step easy tutorial to learn how to create and drop table in SQL Server via Query Editor. Don't forget to check out our site http://howtech.tv/ for more free how-to videos! http://youtube.com/ithowtovids - our feed http://www.facebook.com/howtechtv - join us on facebook https://plus.google.com/103440382717658277879 - our group in Google+ In this tutorial we will guide you on creating tables in SQL Server. As we know, the main components in databases are the tables, in which the data actually resides. Tables contain rows and columns, where columns act like the entity identifiers such as employee name, employee salary etc and rows contain the data values for those entities. So in this tutorial we will see how to create tables in SQL Server. Step 1 -- Navigating to the Desired Database Creating tables in SQL server is very easy. It can be done via commands which have to be written in the Query Editor. For that, first of all, let's move to the database where the table has to be created. Expand the Databases folders from top and further expand the required database inside which table has to be created. After that, right click on that Database and open up the Query Editor. Step 2 -- Creating Table In the Query Editor we will write the following queries: create table Inventory ( ID int, Product varchar(50), Quantity int, Price decimal (18,2) ); The query here means that we are interested to create a new table which would be called Inventory. It will have an ID column for the Product Ids and its Data type would be an Integer. It will have a column for Products containing the product names, so its data type would be Varchar. It will also contain a Quantity field with Integer set as its data type And last of all, a column for Price that will accept data as real numbers. Therefore we will declare its type as decimal and set its maximum length as 18 with a precision of 2 decimal places. After that is done, click on the Execute Button on top. A message will appear below the Query Editor that the query has been executed successfully. Step 3 -- Identifying the Table Now for verifying whether the table has been made, just click on the Tables icon and then on the Refresh Icon, located under the Object Explorer. With that done, our newly created Inventory table would appear over there. Click on the Inventory table and expand its columns. The fields would appear to be created exactly like we had mentioned in the query earlier. Step 4 -- Drop Table Now let's move on to how to drop tables in SQL. To delete a table and all of its contents, we use the DROP table command in SQL. Over here, let's drop the table we just made. For that, simply write: drop table Inventory With that done, let's execute the command. Now when we will Refresh the Object Explorer, we can see that the Inventory table has been deleted. And that was how to create table in SQL.
Creating functions with PostgreSQL
 
01:08
How to create and run functions in PostgreSQL Code used in the video ---- We're going to create a database to store the electronic documentation -- For each document we need to know -- file name (name + extension) -- who has created the document with some contact data -- version (example: 3.1, 5.2, ...) -- summary info -- date of creation DROP TABLE IF EXISTS tbl_docs; DROP TYPE IF EXISTS tp_file; DROP TYPE IF EXISTS tp_version; DROP TYPE IF EXISTS tp_fileName; DROP TABLE IF EXISTS tbl_author; DROP TYPE IF EXISTS tp_author; -- First we create the type for author CREATE TYPE tp_author as ( ID char(10), name varchar(100), telf varchar(12), email varchar(255) ); -- Creating the table to store the authors collaborators CREATE TABLE tbl_author OF tp_author ( PRIMARY KEY (ID) ); -- Inserting some authors INSERT INTO tbl_author VALUES ( '0000000001', -- ID, 'Joan Pi', -- NAME '659...', -- TELEPHONE '[email protected]' -- EMAIL ); SELECT * FROM tbl_author; -- We need to create version type -- version (example: 3.1, 5.2, ...) -- major and minor CREATE TYPE tp_version AS ( major int, minor int ); -- Creating filename and file types -- file name (name + extension) CREATE TYPE tp_fileName AS ( name varchar(200), extension varchar(10) ); -- Info related to type file -- file name (name + extension) -- who has created the document with some contact data -- version (example: 3.1, 5.2, ...) -- summary info -- date of creation CREATE TYPE tp_file AS ( name tp_filename, description text, -- summary info idAuthor char(10), -- field related to authors table. We associated on table creation createdDate timestamp with time zone, -- date of creation version tp_version -- Version of the document ); -- Creating the table to store the document's info CREATE TABLE tbl_docs of tp_file ( PRIMARY KEY (name,version), CONSTRAINT FK_AUTHOR -- Associating idAuthor with ID field of tbl_author FOREIGN KEY (idAuthor) REFERENCES tbl_author(ID) ); -- INSERTING SOME DATA ON tbl_docs INSERT INTO tbl_docs VALUES ( ROW('Requirements','odt')::tp_filename, -- name,extension. specify ::tp_filename is optional 'Requirements ....', -- description '0000000001', -- author identification. Must exist in tbl_author '2018-07-03 12:25:00', -- creation date ROW(3,1) -- version . In this case cast (::tp_version) not specified ); SELECT * FROM tbl_docs; -- With PostgreSQL we can create functions to add functionality to our database. You can execute from an external -- program for example using Java language or from a PostgreSQL client. -- In this video we're going to use a previous database. We've included the code above. -- The purpose of our function is to get the filename as string. The filename is composed in two parts: -- the name and the extension. -- f(x)=name + '.' + extension CREATE OR REPLACE FUNCTION fn_filename(name tp_filename) RETURNS text AS $$ BEGIN RETURN (name).name || '.' || (name).extension; -- concat operator in PostgreSQL is || END $$ LANGUAGE plpgsql; -- Getting name and description from tbl_docs SELECT name, description from tbl_docs; -- name column returns data in a format object -- Using the function we get the filename as name.extension (Requirements.dot) SELECT fn_filename(name) AS filename, description FROM tbl_docs; #FpInfor #Dam #DamMp02 #DamMp02Uf4
Views: 87 Miquel Boada
Exists clause in SQL Server - Part 29 Tamil
 
06:15
Subscribe to IT PORT : https://www.youtube.com/c/itport28 SQL Server Tutorial in Tamil : https://www.youtube.com/playlist?list=PLouAaeZ4xQ64enJDwWVvN3KduuZRlUrb3 SQL Server Concepts in Tamil : https://www.youtube.com/playlist?list=PLouAaeZ4xQ67kdNIByJKAGBIBhor_h4Hs SQL Server Analytic Functions in Tamil : https://www.youtube.com/playlist?list=PLouAaeZ4xQ65XIU5azEUgLVrBKEl-jWMV SQL Server Tutorial : https://www.youtube.com/playlist?list=PLouAaeZ4xQ66AYrzPtxt2SeeR4UABcBcO SQL Server Concepts : https://www.youtube.com/playlist?list=PLouAaeZ4xQ66zRe8-nDDy-YHY2o0rmbn4 SQL Server Analytic Functions : https://www.youtube.com/playlist?list=PLouAaeZ4xQ64hTsEdhLsVBquE1vERWngX The EXISTS clause is used to test for the existence of any record in a sub query and it returns true if the sub query returns one or more records. Explained in Tamil
Views: 121 IT Port

La femme est l'avenir de l'homme dissertation titles
This i believe essay tony hawk
Visual style film essay how to
Develop your sociological imagination essay
European union citizenship essay questions