Naming Convention for Tables in MySQL

Rama Giri
Updated on 28-Jan-2020 12:22:05

576 Views

No, MySQL does not have a preferred naming convention standard. If the name we have chosen is logical and consistent then it would be ok.Two major points need to be remembered, one is that no two tales/databases can have the same name and second we can choose any of the reserved words as the name of table/database.

String Special Operators in Python

Mohd Mohtashim
Updated on 28-Jan-2020 12:21:20

3K+ Views

Assume string variable a holds 'Hello' and variable b holds 'Python', then −Sr.NoOperator & DescriptionExample1+Concatenation - Adds values on either side of the operatora + b will give HelloPython2*Repetition - Creates new strings, concatenating multiple copies of the same stringa*2 will give-HelloHello3[]Slice - Gives the character from the given indexa[1] will give e4[ : ]Range Slice - Gives the characters from the given rangea[1:4] will give ell5inMembership - Returns true if a character exists in the given stringH in a will give 16not inMembership - Returns true if a character does not exist in the given stringM not in a ... Read More

Create a Table from an Existing MySQL Table

Swarali Sree
Updated on 28-Jan-2020 12:20:27

263 Views

With the help of CTAS i.e. “Create Table AS Select” script we can create a table from an existing table. It copies the table structure as well as data from the existing table. Consider the following example in which we have created a table named EMP_BACKUP from already existing table named ‘Employee’ −mysql> Select * from Employee; +------+--------+ | Id   | Name   | +------+--------+ | 100  | Ram    | | 200  | Gaurav | | 300  | Mohan  | +------+--------+ 3 rows in set (0.00 sec)The query above shows the data in table ’Employee’ and the query ... Read More

Updating Strings in Python

Mohd Mohtashim
Updated on 28-Jan-2020 12:20:12

3K+ Views

You can "update" an existing string by (re)assigning a variable to another string. The new value can be related to its previous value or to a completely different string altogether. For example −Example Live Demo#!/usr/bin/python var1 = 'Hello World!' print "Updated String :- ", var1[:6] + 'Python'OutputWhen the above code is executed, it produces the following result −Updated String :- Hello Python

Get the First Day of the Current Month in MySQL

Priya Pallavi
Updated on 28-Jan-2020 12:19:18

2K+ Views

With the help of following MySQL query, we can get the first day of the current month −mysql> SELECT DATE_SUB(LAST_DAY(NOW()),INTERVAL DAY(LAST_DAY(NOW()))- 1 DAY) AS 'FIRST DAY OF CURRENT MONTH'; +----------------------------+ | FIRST DAY OF CURRENT MONTH | +----------------------------+ | 2017-10-01                 | +----------------------------+ 1 row in set (0.00 sec)

Accessing Values of Strings in Python

Mohd Mohtashim
Updated on 28-Jan-2020 11:44:45

2K+ Views

Python does not support a character type; these are treated as strings of length one, thus also considered a substring.ExampleTo access substrings, use the square brackets for slicing along with the index or indices to obtain your substring. For example − Live Demo#!/usr/bin/python var1 = 'Hello World!' var2 = "Python Programming" print "var1[0]: ", var1[0] print "var2[1:5]: ", var2[1:5]OutputWhen the above code is executed, it produces the following result −var1[0]: H var2[1:5]: ytho

Random Number Functions in Python

Mohd Mohtashim
Updated on 28-Jan-2020 11:43:01

561 Views

Random numbers are used for games, simulations, testing, security, and privacy applications. Python includes following functions that are commonly used.Sr.NoFunction & Description1choice(seq)A random item from a list, tuple, or string.2randrange ([start, ] stop [, step])A randomly selected element from range(start, stop, step)3random()A random float r, such that 0 is less than or equal to r and r is less than 14seed([x])Sets the integer starting value used in generating random numbers. Call this function before calling any other random module function. Returns None.5shuffle(lst)Randomizes the items of a list in place. Returns None.6uniform(x, y)A random float r, such that x is less ... Read More

Gadget Updates of the Week 3-16

Samual Sam
Updated on 28-Jan-2020 11:42:41

196 Views

The New Oppo F1 SmartphoneDual SIM, Lollipop OS 5.1, 13 Megapixel camera, 2500 mAh Li-Po battery, 16GB internal storage, all packed in this powerhouse of an Oppo phone is its first in the F series that, as per the company, will focus on photography.Known for its camera advancements, Oppo is a powerful machine and is all set in a slim aluminium body.Set to release in India this month, let’s wish it is all the promised good features and beyond.Polaroid Snap + Instant Print CameraPolaroid proper is no more, but its brand-name and uniqueness are still around in various reanimated forms. ... Read More

Getting Ready for Analytics

Samual Sam
Updated on 28-Jan-2020 11:32:14

226 Views

In today’s rapidly changing business world, it is critical for business leaders to have the right insight and data to make the right calls at the right time. Finding the right blend of what, why and how to use this enormous amount of data is something that needs attention in present day competitive business environment.Business strategies and operational decisions are being undertaken based on the analysis provided by past operational data. Hence it is tremendously important for global business entities to equip themselves with the emerging technologies like business analytics software for better decision making and forecasting.Business Decisions + Analytics ... Read More

Google Duo: A Revolutionary Video Calling App

Samual Sam
Updated on 28-Jan-2020 11:30:08

255 Views

The world has been chatting; sharing all the way from the day Facebook has entered the digital world. Then came the biggest revolution of WhatsApp, which has taken the world by surprise when it made easy for users by removing the registration process and made texting a daily habit replacing SMS. Sharing your favorite pictures, videos just through a click from your mobile or tablet has become a pastime for many. This was indeed a digital revolution when it comes to social networking.Moments turn into memories when there are dear ones around. As it is said, maybe in distance but ... Read More

Advertisements