To set alias for column names, the syntax is as follows −select yourColumnName1 anyAliasName1, yourColumnName2 anyAliasName2 from yourTableName anyAliasName;To understand the above syntax, let us create a table −mysql> create table DemoTable2014 -> ( -> FirstName varchar(20), -> LastName varchar(20) -> ); Query OK, 0 rows affected (0.70 sec)Insert some records in the table using insert command −mysql> insert into DemoTable2014 values('John', 'Smith'); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable2014 values('David', 'Miller'); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable2014 values('John', 'Doe'); Query OK, ... Read More
Let us first create a table −mysql> create table DemoTable2013 -> ( -> Name varchar(20) -> ); Query OK, 0 rows affected (0.63 sec)Insert some records in the table using insert command −mysql> insert into DemoTable2013 values('Chris'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable2013 values('David'); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable2013 values('Mike'); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable2013 values('Sam'); Query OK, 1 row affected (0.10 sec) mysql> insert into DemoTable2013 values('Bob'); Query OK, 1 row affected (0.12 sec)Display all ... Read More
To format date while inserting records, use DATE_FORMAT() in the MySQL INSERT statement. Let us first create a table −mysql> create table DemoTable2012 -> ( -> ShippingDate varchar(20) -> ); Query OK, 0 rows affected (0.48 sec)Insert some records in the table using insert command −mysql> insert into DemoTable2012 values(date_format(curdate(), '%d.%m.%Y')); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable2012 values(date_format(now(), '%d.%m.%Y')); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable2012 values(date_format('2014-01-21', '%d.%m.%Y')); Query OK, 1 row affected (0.17 sec)Display all records from the table using select statement −mysql> select *from ... Read More
To execute SHOW CREATE TABLE in a stored procedure, use SHOW CREATE TABLE. Let us first create a table −mysql> create table DemoTable2011 -> ( -> StudentId int NOT NULL AUTO_INCREMENT, -> StudentName varchar(20), -> StudentAge int, -> StudentCountryName varchar(20), -> PRIMARY KEY(StudentId) -> ); Query OK, 0 rows affected (0.80 sec)Following is the stored procedure executing SHOW CREATE TABLE −mysql> delimiter // mysql> create procedure test_show_create_demo(table_name varchar(100)) -> begin -> set @query=concat("SHOW CREATE TABLE ", table_name); -> prepare st from @query; -> execute st; -> end ... Read More
The directory structure of JDK and JRE are almost the same, except that JDK has two additional directories like jmods and include and also there is no JRE subdirectory in the JDK9 version. The JDK directory is the root directory for JDK software installation. This directory also includes copyright, readme, and src.zip files, which can be a source code archive file of the Java platform.JDK Directory Structure:JDK-9 - bin - conf - include - jmods - legal - libThe JDK/bin directory contains an executable and command-line launcher that can be defined by the modules linked to an image.The JDK/conf directory contains ... Read More
Following is the code to create modal image gallery with CSS and JavaScript −Example Live Demo
Following is the code to produce a fixed social media icon bar with CSS −Example Live Demo *, *::before, *::after { box-sizing: border-box; } main { margin-left: 300px; } .SocialBar { position: fixed; display: block; top: 30%; font-size: 0; width: 200px; border: 2px solid darkgreen; box-shadow: 5px 10px 18px rgb(55, 173, 39); } button { display: block; width: 100%; margin: 0px; border: none; padding: 15px; font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; font-weight: bold; font-size: 20px; } button:not(:last-child) { ... Read More
Following is the code to create a dropup menu with CSS −Example Live Demo .menu-btn { background-color: #7e32d4; color: white; padding: 16px; font-size: 20px; font-weight: bolder; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; border: none; } .dropdown-menu { position: relative; display: inline-block; padding-top: 130px; } .menu-content { display: none; position: absolute; bottom: 50px; background-color: #017575; min-width: 160px; z-index: 1; } .links { color: rgb(255, 255, 255); padding: 12px 16px; text-decoration: none; display: block; font-size: 18px; font-weight: bold; border-bottom: 1px solid black; } .links:hover { background-color: rgb(8, 107, 46); } .dropdown-menu:hover .menu-content { display: block; } .dropdown-menu:hover .menu-btn { background-color: #3e8e41; } Hover over the below button to open a dropup menu Open
To get the free space in a drive, use the AvailableFreeSpace and TotalFreeSpace properties in C#.Firstly, set the name of the drive using DriveInfo −DriveInfo dInfo = new DriveInfo("D");Let’s say, you need to find the available space for D drive −Exampleusing System; using System.Linq; using System.IO; public class Demo { public static void Main() { DriveInfo dInfo = new DriveInfo("D"); // Get free space Console.WriteLine(dInfo.AvailableFreeSpace); // get total free space Console.WriteLine(dInfo.TotalFreeSpace); } }OutputThe following is the output showing the free space available in D drive−722243567912 722243567912
Use the DriveFormat property to get the drive format in C#.Set the drive for which you want to display the format −DriveInfo dInfo = new DriveInfo("C");Now, use DriveFormat to get the drive format −dInfo.DriveFormatThe drive formats for a windows system can be NTFS or FAT32.Here is the complete code −Exampleusing System; using System.Linq; using System.IO; public class Demo { public static void Main() { DriveInfo dInfo = new DriveInfo("C"); Console.WriteLine("Drive Format = "+dInfo.DriveFormat); } }OutputThe following is the output −Drive Format = NTFS
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP