Arjun Thakur has Published 1109 Articles

Best way to store weekly event in MySQL?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

182 Views

Let us see the best way to store weekly events in MySQL. For that, first create a new table and include fields for every day as well.mysql> create table WeeklyEventDemo -> ( -> ID int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> ... Read More

Resolve error 1045 (28000) access denied for user 'root'@'localhost' (using password: YES)?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

4K+ Views

To fix this error, you need to specify the -p option for password.The syntax is as followsmysql -uyourUserName -pLet us implement it.First, we need to open CMD using Windows+R shortcut keys. The snapshot is as followsType CMD and press OK button. You will get a command prompt.The snapshot is as ... Read More

Retrieving the first document in a MongoDB collection?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

3K+ Views

To retrieve the first document in a collection, you can use findOne(). Following is the syntaxvar anyVariableName=db.yourCollectionName.findOne(); //To print result at MongoDB console write the variable name yourVariableNameLet us first create a collection with documents> db.retrieveFirstDocumentDemo.insertOne({"ClientName":"Robert", "ClientAge":23}); {    "acknowledged" : true,    "insertedId" : ObjectId("5ca2325966324ffac2a7dc6d") } > db.retrieveFirstDocumentDemo.insertOne({"ClientName":"Chris", "ClientAge":26}); ... Read More

8086 program to multiply two 16-bit numbers

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

9K+ Views

In this program we will see how to multiply two 16-bit numbers.Problem StatementWrite 8086 Assembly language program to multiply two 16-bit number stored in memory location 3000H – 3001H and 3002H – 3003H.DiscussionWe can do multiplication in 8086 with MUL instruction. For 16-bit data the result may exceed the range, ... Read More

The setAtX() method of the Decade Tuple in Java

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

55 Views

The setAtX() method is used to set a new value in the Decade Tuple. Here, X is the index wherein you want to set the value. For example, setAt5() sets the value at index 5. The value to be included is to be set as the value in the parameter, ... Read More

How to create a common error page using JSP?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

1K+ Views

JSP gives you an option to specify Error Page for each JSP using page attribute. Whenever the page throws an exception, the JSP container automatically invokes the error page.Following is an example to specifiy an error page for a main.jsp. To set up an error page, use the directive. ... Read More

How do we print a variable at the MongoDB command prompt?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

2K+ Views

In order to print a variable at the MongoDB command prompt, use the following syntax//Declaring and Initializing a variable. var anyVariableName=yourValue; //To print the above variable. yourVariableName; Or print(yourVariableName);Following is how you can declare and initialize a variable at the MongoDB command prompt> var myIntegerValue=20;Print a variable at the MongoDB ... Read More

Apply MySQL query to each table in a database?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

203 Views

To apply MySQL query to each table in a database, you can use INFORMATION_SCHEMA.TABLES. Following is the syntax −SELECT SUM(TABLE_ROWS) AS anyAliasName FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=yourDatabaseName;Let us implement the above syntax to query each table in a database.mysql> SELECT SUM(TABLE_ROWS) AS Total FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA= DATABASE();This will produce the ... Read More

Use MySQL concat() and lower() effectively

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

796 Views

The contact() method is used to concatenate. However, lower() is used to change the case to lowercase. For our example, let us create a table.The query to create a table is as followsmysql> create table concatAndLowerDemo    -> (    -> FirstValue varchar(10),    -> SecondValue varchar(10),    -> ThirdValue ... Read More

8086 program to find average of n numbers

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:25

6K+ Views

In this program we will see how to find the average of n numbers in a given series.Problem StatementWrite 8086 Assembly language program to find the average of n numbers stored in a given series starts from memory offset 501. The size of the series is stored at memory offset ... Read More

Advertisements